Repository navigation
fix(platform): re-target the pending review when the reviewer changes - #3517
Merged
Merged
Conversation
A task review stamps `requestedFor` once, at mint, and a later change of Reviewer never reached it: the board chip, "Needs my review" and the actionable request bell stayed with the reviewer the review was taken from, while the new designee got only the non-actionable heads-up. updateTask now calls retargetPendingTaskReview in the same transaction as the reviewer_user_id write. It resolves the open workflow-free review through the mint's own chain (a clear lands on the task creator, then the project creator), rewrites `requestedFor`, dismisses the previous reviewer's request bell, subscribes the new reviewer and sends them the request, asked by the person who made the change. A designee who holds the open request is not also sent the heads-up, which shares its collapse identity and would rewrite the actionable bell in place. Covered by unit suites for the re-target and the updateTask wiring, and by two real-Postgres checks in checkTasksCollabIntegrity; the task-automation guide says so in EN/DE/FR and PROJ-F32 holds the live two-session check.
This was referenced Sep 27, 2026
yannickmonney
added a commit
that referenced
this pull request
Sep 28, 2026
Three gaps left open by the reviewer re-target (#3517): - Erasure stamped a review still waiting on the subject with the pseudonym, so it waited on nobody. The review pass now clears the designation first, hands each waiting review on through the chain a cleared designation takes (task creator, then project creator, the subject skipped in every slot) and rings the new reviewer as the system; only what still names the subject is pseudonymized after. - Changing or clearing the reviewer before In review left the previous designee's unread "You're the reviewer" heads-up ringing; it is now marked read when the designation moves. - A designee who cannot edit the project was stored and then routed past at mint. The designation is held to the same rule the gate resolves by (reviewerEligibility) and refused with 400 TASK_REVIEWER_NO_EDIT_ACCESS; the task dialog names the refusal with the picker's own hint. Manual boxes PROJ-F33, PROJ-F34 and PROJ-B9, their automation rows, the error-code row, and the data subject request docs (EN/DE/FR).
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.
What changed
A task review stamps
metadata.requestedForonce, when it is minted (requestTaskReview), and alater change of Reviewer never reached it. The board chip ("Waiting on {name}" / "Waiting on
you"), the Needs my review facet and the actionable request bell all read that field, so after
A → B mid-review the review stayed with A. B got only the non-actionable "You're the reviewer"
heads-up. The guide already promises that Reviewer "routes the notification and review queue".
backend/domains/tasks/reviews.ts: newretargetPendingTaskReview(tx, { task, actorUserId }).For each pending, workflow-free
task_reviewrow (the same set the status-leave close handles),it resolves the reviewer through the mint's own
resolveReviewerchain. A new designee withproject edit access takes the review; a clear hands it to the resolved default (human task
creator → project creator), and a non-editor designee falls through the chain as at mint. When
the reviewer changes, it rewrites
requestedFor(guardedstatus = 'pending'), dismisses theprevious reviewer's request bell and subscribes the new reviewer. It then sends them
task_review_requested(actionable, so it e-mails) from the person who made the change, whichmeans taking a review yourself rings nobody.
backend/domains/tasks/service.ts(updateTask): calls it in the same transaction as thereviewer_user_idwrite whenever the reviewer changes. A designee who now holds the openrequest is no longer also sent the heads-up. Both bells share the
task:<id>:reviewcollapseidentity, so the heads-up used to rewrite the actionable request in place, turning it into a row
that
dismissReviewRequestNotificationscan no longer clear.platform/projects/task-automation.md): one paragraph on handing a waitingreview over and on Clear reviewer.
PROJ-F32(live two-session hand-over) plus itsreference/automation.mdrowfor the automated backend half.
No schema change, no new strings, no contract change:
TaskReview.requestedForis still "thereviewer the request named".
How I verified it
bunx vitest run --project server backend/domains/tasks/ backend/rest/v1-tasks.review.test.ts backend/rest/v1-tasks.test.ts backend/domains/collab/ backend/domains/projects/routes.test.ts:33 files, 290 tests pass. New:
reviews.retarget.test.ts(7 cases: hand-over, clear → creator,→ project creator, nobody resolves, non-editor designee, no-op, decided or workflow-era rows
untouched) and
service.reviewer.test.ts(5 cases: the same-tx call with the updated task, theheads-up held back or sent, clear, unchanged reviewer).
bunx oxlint --type-aware --type-check backend/domains/tasks/ backend/integration-check.ts:clean.
oxfmt --checkrepo-wide: clean.bun run lint:manual: ok.check-guide.tsonsuites/projects.md: OK. Docs suite (services/docs,bunx vitest run): 34 files, 166 testspass.
ITEST_LANES=checkTasksCollabIntegrity,checkReviewArc,two new checks driving the app doors (designate A → In review → designate B → clear):
and chip still name A, A still "waits on" it, B holds only
task_reviewer_assigned:unread, Akeeps
task_review_requested:unread, and a clear leaves it on A.ParadeDB
pg_search; the local Postgres doesn't have it.backend:integrationis not a CI job, so this local run is the real-Postgres proof.CI note:
@tale/platform:test,:typecheckand:lintexecuted on this PR (cache miss, executing); the Unit log lists both new suites.@tale/docs:testwas replayed from cachebecause the repo-root
docs/tree it reads is not among its Turborepo inputs, so the local docsrun above is the proof for the three edited pages.
Left open (not in this change)
requestedForto the erased sentinel instead ofre-targeting it (
backend/domains/erasure/service.ts,reviewDecisionspass).past them, as it does at mint.