Skip to content

PM-5121: Stop reviewer count stepper loop#1886

Merged
jmgasper merged 1 commit into
devfrom
PM-5121-1
May 26, 2026
Merged

PM-5121: Stop reviewer count stepper loop#1886
jmgasper merged 1 commit into
devfrom
PM-5121-1

Conversation

@jmgasper
Copy link
Copy Markdown
Collaborator

What was broken

The prior PM-5121 fix capped large reviewer counts, but QA still reproduced the freeze by closing the public review opportunity and clicking the Reviewer Count down stepper.

Root cause (if identifiable)

Closed-opportunity member selectors can leave blank additionalMemberIds slots registered in react-hook-form. When the reviewer count dropped, the trimming effect treated those blank hidden slots as data to write back during validation, allowing the reviewer watcher cleanup path to re-enter repeatedly.

What was changed

Unregistered additional member fields that are no longer visible when reviewer count shrinks, and only write/delete additional members when an actual assigned member value is being removed or preserved.

Any added/updated tests

Added HumanReviewTab coverage for decreasing reviewer count with a blank extra assignment slot and asserting no reviewer resource deletion is attempted.

Validation:

  • yarn lint passed.
  • yarn test:no-watch --runTestsByPath src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ReviewersField/HumanReviewTab.spec.tsx passed with existing React act warnings.
  • yarn run build passed with existing warnings.
  • yarn test:no-watch was run and still fails in unrelated existing suites, including wallet-admin alias resolution, engagement/payment assignment utility mocks, and existing engagement schema/assignment-card expectations.

What was broken
The prior PM-5121 fix capped large reviewer counts, but the Work app could still freeze after the public review opportunity was closed and the Reviewer Count native stepper was decremented.

Root cause (if identifiable)
Closed-opportunity member selectors can leave blank additionalMemberIds slots registered in react-hook-form. When the count dropped, the trimming effect wrote those blank slots back during validation instead of unregistering them, allowing the form watcher to re-enter the same cleanup path.

What was changed
Unregistered additional member fields that are no longer visible when reviewer count shrinks, and only write/delete additional members when an actual assigned member value is being removed or preserved.

Any added/updated tests
Added HumanReviewTab coverage for decreasing reviewer count with a blank extra assignment slot and asserting no reviewer resource deletion is attempted.
@jmgasper jmgasper requested a review from kkartunov as a code owner May 26, 2026 05:14
@jmgasper jmgasper merged commit 7a3707b into dev May 26, 2026
7 checks passed
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