Skip to content

v0.0.0.1 feat: add duplicate upload rejection reason - #332

Merged
ohld merged 2 commits into
productionfrom
codex/upload-review-bayan
Jul 17, 2026
Merged

v0.0.0.1 feat: add duplicate upload rejection reason#332
ohld merged 2 commits into
productionfrom
codex/upload-review-bayan

Conversation

@ohld

@ohld ohld commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a 🔁 Баян rejection button to the existing upload-review reason row.
  • Route reject_duplicate through the normal rejection path and store MemeStatus.REJECTED.
  • Notify the uploader with the existing localized message explaining that the meme is already in the collection.

Test coverage

review_keyboard()                         moderator clicks «🔁 Баян»
├─ button in rejection-reason row         ├─ callback is accepted
└─ reject_duplicate callback              ├─ status becomes REJECTED
                                           ├─ review caption says «Баян»
handler                                   └─ uploader receives duplicate notice
├─ recognizes the new action
├─ maps it to localized copy              localization
└─ uses the existing rejection flow       ├─ English checked
                                           └─ Russian checked

Coverage: 6/6 changed behavior paths tested (100%); no untested gaps identified.

Verification

  • pytest tests/tgbot/test_upload_moderation.py -q — 8 passed.
  • Full CI-like suite with temporary PostgreSQL and Redis — 736 passed, 2 skipped.
  • ruff check src/ tests/ — passed.
  • ruff format --check src/ tests/ — passed.
  • git diff --check — passed.

Pre-landing review

  • Testing, maintainability, performance, and independent adversarial reviews completed.
  • No findings against the production change.
  • One informational test-duplication suggestion was intentionally deferred: this is the second repetition, and the project preference is to keep MVP test setup inline until a third repetition justifies extraction.
  • Review also surfaced a pre-existing generic race between concurrent moderation callbacks. It affects existing approve/reject actions and is not introduced or expanded by this PR; it should be handled separately.

Scope and documentation

  • Scope audit: clean; only the moderation handler, its tests, and release metadata changed.
  • No database migration, public API, frontend, or infrastructure changes.
  • No matching product-plan or TODO item was found.
  • Documentation release check: no README/spec/architecture updates needed; the existing moderation docs and new changelog entry cover the change.

Test plan

The release test plan is recorded in the local gstack project artifacts. The user-visible path is covered at callback level because this workflow runs inside the private Telegram moderation chat rather than a browser UI.


Generated with Codex

@ohld

ohld commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

STAFF ENGINEER REVIEW: APPROVED — Upload duplicate rejection reason is clean.

Checked the upload-review callback path, duplicate rejection mapping, localization, payout side effects, sensitive upload/moderation surface, and public-repo secret guard. The new reject_duplicate action reuses the existing rejection path and stores MemeStatus.REJECTED; no distinct authorization, payout, SQL, or secret-handling regression found.

Verification: GitHub lint and test checks are green on the PR head. Local targeted pytest was attempted from an isolated worktree but host collection failed because the ambient DATABASE_URL dialect is postgres; CI uses the correct postgresql+asyncpg URL and passed. Codex review: clean, no [P1] findings.

@ohld
ohld merged commit 96c2d71 into production Jul 17, 2026
3 checks passed
@ohld

ohld commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

✅ Approved + merged.

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