Skip to content

Open Peer Check: allow edit/submit and assign peer checker on submit #335

Closed

Description

@JonathanSeehagen

Why

Mobile product wants implicit Peer Checker assignment: when a chapter reaches Peer Check without a pre-assigned checker, eligible peers can work the item, and whoever taps Send to Community Review becomes the recorded Peer Checker.

Today the API blocks that flow. When status === peer_check and peerCheckerId is null, ChapterAssignmentPolicy.edit / submit require peerCheckerId === user.id — so nobody can edit, upload verse audio (verse-audio auth uses the same edit policy), or PATCH /chapter-assignments/{id}/submit.

@mattrace-gloo flagged this as an API blocker on the mobile ticket before mobile UI can ship: fluent-mobile#442#issuecomment-5622893731.

Unblocks / related

Web uses PM assign for Peer Check today — open Peer Check is new API behavior aligned with mobile, not catch-up to web.

Current state (main)

  • ChapterAssignmentPolicy.edit / submit: peer_check requires peerCheckerId === user.id
  • Open Peer Check (peerCheckerId == null): no translator can upload verse audio, write translated verses, or submit
  • submitChapterAssignment does not take the acting user and does not set peerCheckerId on peer_check → community_review
  • PM assign path can set peerCheckerId — exclusive assignee behavior must stay unchanged

Proposed scope

  1. Policy (ChapterAssignmentPolicy.edit / submit)

    • When status === peer_check and peerCheckerId == null: allow project members with content:update who are not the drafter (assignedUserId).
    • Deny the drafter on open Peer Check (align with mobile AC).
    • When peerCheckerId is already set (PM assign): keep exclusive checker behavior (unchanged).
    • Managers (content:assign) keep existing post-peer rules — do not open translator Peer Check rules for them.
  2. Submit (PATCH /chapter-assignments/{id}/submit)

    • Pass authenticated user into submit.
    • On advance from open Peer Check: set peerCheckerId to the submitter in the same transaction; write peer-checker assignment history.
    • Concurrent open Peer Check submits: first-wins; loser no-ops with current assignment (no special conflict type).
  3. Tests

    • Policy (open allow / deny drafter / PM exclusive / non-member denied)
    • Conditional submit update (CAS on open peer_checker_id)
    • Service race + route wiring

Acceptance criteria

  • Non-drafter project member with content:update can edit/submit on open Peer Check (peerCheckerId null)
  • Drafter is denied edit/submit on open Peer Check
  • Submit from open Peer Check sets peerCheckerId to submitter and advances to community_review
  • PM-assigned peerCheckerId exclusivity unchanged
  • Concurrent open Peer Check submits: first-wins; no invalid checker assignment
  • Manual QA: claim → draft → submit (T1) → open peer_check → T2 presence/submit → community_review with peerCheckerId = T2
  • No OpenAPI contract change — submit stays PATCH with no body and the checker is derived from the authenticated user; covered by tests on policy, repository, service and route
  • Deny edit/submit on open Peer Check when assignedUserId is null (inconsistent data)

Notes

Mobile should not ship alone against API without these changes (403 / false “done”). QA join point: API + mobile on the same release train.

Product details live on mobile #442 — match those behaviors where possible.

Activity

  1. moved this to In Progress (Product) in Fluenton Sep 16, 2026
  2. moved this from In Progress (Product) to In PR Review in Fluenton Sep 16, 2026
  3. moved this from In PR Review to In QA in Fluenton Sep 18, 2026
  4. Roslin22 commented on Oct 20, 2026

    @Roslin22

    Test Results

    1. When an unassigned chapter is opened in offline mode, Translator 1 records all verses and sends the chapter to Peer Check. The status updates in the mobile app before synchronization.
    2. On the same device, Translator 2 opens the chapter, records the verses as the peer checker, and successfully moves the chapter to the next workflow stage. The chapter appears in the My Work tab.
    3. After synchronization, the recorded audio is uploaded and displayed correctly.
    4. When the same chapter is accessed from different devices, the user whose device syncs first is assigned to the chapter.

    Issues Identified (Same and Different Devices)

    1. When Translator 1 records an unassigned chapter offline, the assignment is updated in the web app after synchronization. However, if Translator 1 moves the chapter from Drafting to Peer Check while offline, the status reverts to Drafting after synchronization. The translator must send the chapter to Peer Check again.
    2. The same issue occurs with the peer checker. When the peer checker moves the chapter to the next workflow stage while offline, the status reverts after synchronization, requiring the user to repeat the action.

    @chadw-eten, these issues are related to mobile. Could you please suggest where can report these issues, mobile or Web?

  5. chadw-eten commented on Oct 20, 2026

    @chadw-eten

    I'm confused on the two reported issues. Line 3 above seems to indicate that synchronization works and, I assume, the stage is part of what is working. How are these different?

    @JonathanSeehagen Heads up on this as an issue that is coming your way. I assume this is a good place to report this?

  6. JonathanSeehagen commented on Oct 22, 2026

    @JonathanSeehagen
    ContributorAuthor

    @chadw-eten I looked at Roslin’s notes. Line 3 is audio: takes do upload after reconnect. The two issues are the stage change: offline Send to Peer Check (and the same for the peer checker’s next stage) never reaches the server, so after sync the chapter is Drafting again and the user has to Send a second time.

    That is already covered by eten-tech-foundation/fluent-mobile#257 — not a new API bug. I’m implementing that issue as the fix for what she reported.

    This thread is a fine place to have reported it. I’ll point QA at #257 for the retest.

  7. Roslin22 commented on Oct 27, 2026

    @Roslin22

    @chadw-eten and @JonathanSeehagen Due to the current mobile sync issues, we are unable to test this issue at the moment. We will retest it once all sync issues are resolved.

  8. JonathanSeehagen commented on Oct 27, 2026

    @JonathanSeehagen
    ContributorAuthor

    @Roslin22, @chadw-eten, I am still working on eten-tech-foundation/fluent-mobile#257. As soon as I finish, I will let you know here.

  9. moved this from In QA to In Progress (Dev) in Fluenton Oct 28, 2026
  10. JonathanSeehagen commented on Oct 29, 2026

    @JonathanSeehagen
    ContributorAuthor

    @Roslin22, I have completed the #257 and moved to "In QA".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or requestmobile requirementThis issue is a requirement for the mobile application

Type

No type

Projects

  • Status
    In Progress (Dev)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions