feat(contracts): implement content flagging mechanism#270
Closed
Birdmannn wants to merge 338 commits intogeevapp:mainfrom
Closed
feat(contracts): implement content flagging mechanism#270Birdmannn wants to merge 338 commits intogeevapp:mainfrom
Birdmannn wants to merge 338 commits intogeevapp:mainfrom
Conversation
feat: conprehensive post creation validation
feed page
Feature/leaderboard
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
created request modal using figma design
feat: Build modal for creating new giveaways with all required fields
add media upload file
… (Issue 030) - Created MediaCarousel component with image navigation, thumbnails, and keyboard support - Implemented comprehensive post detail page showing: - Creator profile section with avatar, name, and verification badge - Full post title and description (no truncation) - Category and status badges - Media carousel integration (if images present) - Stats grid (entries, likes, burns, winners) - Timeline section (created, ends, time remaining) - Share button with Web Share API and clipboard fallback - Edit button (only visible to post creator) - Entry list placeholder (ready for Issue 037) - Created custom 404 page for invalid post IDs - Implemented responsive design for mobile, tablet, and desktop - Fixed Button asChild errors by restructuring Link/Button hierarchy - All acceptance criteria met and verified
feat: implement post detail page with media carousel and 404 handling…
Closes #Creating authentication endpoints for wallet-based login-74
…/geev into feat/interaction-system
…bution Feat/file upload health contribution
Add GET /api/posts test for search, category, and sort
Emit a contract event after storage is updated in pick_winner with topics giveaway, winner, and winner address; data is [giveaway_id, prize_amount] as a Vec for FCM-style indexing. Single emission when the winner is final. Made-with: Cursor
chore(contracts): emit event when winner claims prize
- Fix parse error in users.test.ts caused by apostrophe in single-quoted string - Fix auth-credentials tests accessing the default stub authorize instead of the real implementation: in NextAuth v5 beta.30, Credentials() stores the user-provided config at .options, so authorize is at .options.authorize
The route was moved from app/api/auth/me/route.ts to (auth)/me/route.ts in upstream main (commit 4ac1a9c). Update the test import accordingly.
- auth-credentials.test.ts: access real authorize via .options.authorize (NextAuth v5 beta.30 stores the user-provided config under .options; .authorize at the top level is always the default stub () => null) - auth.test.ts: update import from @/app/api/auth/me/route to @/app/(auth)/me/route to match upstream rename (commit 4ac1a9c)
test: add coverage for auth/me, credentials, and user profile endpoints (#202)
fix: align frontend Post.type with DB enum ("help-request" → "request") (#203)
…and implement Prisma tests
fix: correct username uniqueness check and field assignment in registration
…tallation and standardizing on pnpm
|
@Birdmannn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
a0fc457 to
358e0d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
What was added
types.rsDataKey::FlagRecord(u64, Address)— tracks whether a specific user has flagged a specific content IDDataKey::FlagCount(u64)— running tally of total flags per content IDError::AlreadyFlagged— returned when a user attempts to flag the same ID more than oncegovernance.rs(new)A new
GovernanceContractwith three public functions:flag_content(env, user, target_id)user. Requires auth, rejects duplicates, increments count, emitsContentFlaggedevent.get_flag_count(env, target_id)has_flagged(env, user, target_id)lib.rsgovernancemodule and re-exportedGovernanceContract/GovernanceContractClient.Anti-spam design
Each flag is keyed by
(target_id, user_address)in persistent storage. A second call from the same user on the same ID returnsError::AlreadyFlaggedimmediately, making spam-flagging impossible at the contract level.Tests (
test.rs)test_flag_content_increments_counttest_flag_content_multiple_userstest_flag_content_duplicate_panicstest_has_flagged_returns_false_before_flaghas_flaggedis false before any flagtest_flag_counts_are_independent_per_idAll 39 tests pass.
Checklist
npx prisma generateafter schema changesnpx prisma migrate devornpx prisma migrate deployas appropriatePost-Merge Steps for Maintainers
If this PR includes changes to the Prisma schema:
Run the following command to apply the migration to your database:
or, for local development:
Ensure your CI pipeline runs the migration before tests (add this step if missing):
Make sure the database user in CI has permission to run migrations.
If you have any questions, please comment on this PR.
this PR closes #210