Skip to content

feat: report listings/users and block users (1.6.3) - #97

Merged
DCT-Berinyuy merged 2 commits into
devfrom
feat/report-block
Oct 6, 2026
Merged

DCT-Berinyuy merged 2 commits into
devfrom
feat/report-block

Conversation

@DCT-Berinyuy

@DCT-Berinyuy DCT-Berinyuy commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Google Play's user-generated content policy requires that users can report content and block other users. This adds both, plus an admin queue for reviewing reports. Bumps to 1.6.3+9.

Closes #

Changes

  • DB (20261019000000_reports_and_blocks.sql):
    • content_reports: insert-only for users; reporter_id comes from the JWT; at most 20 reports per day; a repeat open report for the same target is ignored.
    • user_blocks: RLS limits each user to their own rows.
    • A messages trigger refuses messages between blocked users.
    • Account deletion cleans up both tables.
  • Rust: GET /admin/reports, POST /admin/reports/:id/dismiss, POST /admin/reports/:id/remove-listing.
  • App:
    • A ⋮ menu on book details and in chat: Report listing, Report seller/user, Block or Unblock.
    • The report sheet takes a reason plus optional details.
    • Blocked sellers are hidden from home, search and the offline cache. Blocked conversations are hidden, and the chat input is replaced by an "unblock" bar.
    • New Profile → Blocked users screen.
    • The block list refreshes on launch and every 2 minutes.
    • New Admin → Reports tab.
    • EN and FR strings.

Deploy order: (1) run the migration in prod, (2) deploy Rust on Render, (3) release the app.

Design notes:

  • The chat menu reports the user, not the listing.
  • Unblocking from the Blocked users screen has no confirmation step.
  • A seller's own profile listings are not filtered.

Test plan

  • flutter analyze: 3 issues, all pre-existing (unchanged baseline)
  • flutter test --no-pub: 306 passed. New tests cover the moderation data source (request shapes, 23505 and limit handling), the blocked-seller filters in listings and search, the chat conversation filter and blocked send, the moderation and admin viewmodels, the admin data source and the report-sheet widget.
  • rustfmt --edition 2021 --check on the changed Rust files: clean. Repo-wide cargo fmt --check already fails on untouched files.
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo test: passed in CI against the CI database, including the new reports, blocks and account-deletion tests. Correction: locally these DB tests skipped (no local Postgres); an earlier version of this text wrongly said they ran locally.
  • Migration is idempotent and was tested against the CI database

Checklist

  • Targets dev, not main
  • No secrets, keys, or personal data in code, logs, or screenshots
  • User input is validated; new tables have RLS policies
  • User-facing strings added to both EN and FR ARB files
  • Docs updated if behavior changed (CHANGELOG)

Screenshots

Not captured. The UI is covered by widget tests.

DCT-Berinyuy and others added 2 commits October 6, 2026 09:10
Adds user_blocks and content_reports with RLS, a messages trigger that
refuses messages between blocked users, admin endpoints to dismiss a
report or remove the reported listing, and account-deletion cleanup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Report sheet (reason + details) from book details and chat menus
- Block/unblock users; blocked sellers hidden from home, search and
  offline cache; blocked conversations hidden; blocked sends explained
- Profile -> Blocked users screen
- Admin Reports tab (dismiss / remove listing)
- Tests for data source, filters, viewmodels and report sheet

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
book-bridge Ready Ready Preview Oct 6, 2026 8:48pm UTC

@DCT-Berinyuy
DCT-Berinyuy merged commit 5a2c408 into dev Oct 6, 2026
4 checks passed
@DCT-Berinyuy DCT-Berinyuy mentioned this pull request Oct 6, 2026

This branch was successfully deployed

1 active deployment
Preview — c82575bf Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant