Skip to content

PM-5121: Clear hidden reviewer slots#1889

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

PM-5121: Clear hidden reviewer slots#1889
jmgasper merged 1 commit into
devfrom
PM-5121-2

Conversation

@jmgasper
Copy link
Copy Markdown
Collaborator

What was broken

After closing the public review opportunity, clicking the Reviewer Count down stepper could leave a hidden blank additional member slot in form state and the Work app could become unresponsive.

Root cause (if identifiable)

The prior follow-up unregistered hidden blank additional member fields but returned before clearing the parent additionalMemberIds value. React Hook Form could keep the stale blank array value watched by the reviewer cleanup effect, allowing that cleanup path to run repeatedly.

What was changed

The reviewer-count shrink cleanup now always writes the trimmed additionalMemberIds value back to the form so hidden blank slots are removed from state. Resource deletion remains gated to cases where an actual assigned member id was removed.

Any added/updated tests

Updated the HumanReviewTab regression to follow QA's public-opportunity toggle path, decrease the reviewer count, assert the hidden blank slot is cleared from form state, and confirm no reviewer resource deletion is attempted for blank slots.

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, assignment-card expectations, ChallengePrizesField, and engagement schema expectations.

What was broken

After closing the public review opportunity, clicking the Reviewer Count down stepper could leave a hidden blank additional member slot in form state and the Work app could become unresponsive.

Root cause (if identifiable)

The prior follow-up unregistered hidden blank additional member fields but returned before clearing the parent additionalMemberIds value. React Hook Form could keep the stale blank array value watched by the reviewer cleanup effect, allowing that cleanup path to run repeatedly.

What was changed

The reviewer-count shrink cleanup now always writes the trimmed additionalMemberIds value back to the form so hidden blank slots are removed from state. Resource deletion remains gated to cases where an actual assigned member id was removed.

Any added/updated tests

Updated the HumanReviewTab regression to follow QA's public-opportunity toggle path, decrease the reviewer count, assert the hidden blank slot is cleared from form state, and confirm no reviewer resource deletion is attempted for blank slots.
@jmgasper jmgasper requested a review from kkartunov as a code owner May 27, 2026 00:30
@jmgasper jmgasper merged commit 87ba260 into dev May 27, 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