Skip to content

docs(payouts): write down the two invariants that keep pastes from vanishing - #125

Merged
guarzo merged 1 commit into
mainfrom
worktree-payout-followups
Aug 5, 2026
Merged

docs(payouts): write down the two invariants that keep pastes from vanishing#125
guarzo merged 1 commit into
mainfrom
worktree-payout-followups

Conversation

@guarzo

@guarzo guarzo commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Follow-up to #124. Comment-only; no behaviour change and no rendered output change.

Both files are correct today for reasons that are invisible in the code, and that a reasonable future edit would quietly undo.

appraise-form.tsx — a controlled value with no test holding it down

The controlled textarea is what makes a rejected paste survive. It has no direct test and cannot cheaply get one: appraiseLoot only rejects via TriffError/EsiError, the ESI and triff clients are constructed inside addAppraisedPoolAction rather than injected, and TRIFF_QUOTE_URL is a hardcoded constant. Covering it directly would mean making an external client injectable purely for test reach.

What can actually regress is React 19's post-submit reset, and the composer's a rejected composer submit keeps the loot paste already asserts exactly that against the identical mechanism. The docblock now records that relationship, and states the risk plainly: reverting the controlled value here will not fail any test.

inline-edit.tsxdefaultValue is safe, but only conditionally

InlineEdit uses defaultValue, the same pattern that lost the paste in the other two forms. It is safe here only because every action it wraps rejects by redirect() rather than by returning { ok: false }, so a rejection remounts the component from the server instead of settling in place and letting React blank the field.

That is an invariant about its callers, not a property of the component, and nothing enforced or recorded it. An editor added later whose action returns state would lose the operator's input with nothing to show why. Now recorded, with what to do when it stops holding.

Verification

…nishing

Both of these are comments. Neither changes behaviour, and that is the point:
both files are currently correct for reasons that are invisible in the code
and that a reasonable future edit would undo.

AppraiseForm's controlled textarea has no direct test and cannot easily get
one. The only way to reject that form is a network failure -- appraiseLoot
fails solely through TriffError/EsiError, the clients are constructed inside
addAppraisedPoolAction rather than injected, and TRIFF_QUOTE_URL is a
constant -- so covering it directly would mean making an external client
injectable purely for test reach. What can actually regress is React's
post-submit reset, and the composer's "a rejected composer submit keeps the
loot paste" already asserts that against the identical mechanism. The docblock
now says so, and says the quiet part: reverting the controlled value here will
not fail any test.

InlineEdit uses defaultValue, which is the exact pattern that lost the paste
in the other two forms. It is safe here only because every action it wraps
rejects by redirecting rather than by returning state, so a rejection remounts
the component from the server instead of settling in place. That is an
invariant about its callers, not a property of the component, and nothing
enforced or recorded it. Now recorded, with what to do when it stops holding.

Verified: typecheck, lint, format:check clean; npm test 1083 passed. e2e not
run -- no rendered output changed.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a9ac9df2-a155-4dad-8222-b164a693553c

📥 Commits

Reviewing files that changed from the base of the PR and between 8e71969 and 359bb67.

📒 Files selected for processing (2)
  • src/app/payouts/[id]/appraise-form.tsx
  • src/app/payouts/[id]/inline-edit.tsx

Comment @coderabbitai help to get the list of available commands.

@guarzo
guarzo enabled auto-merge (squash) August 5, 2026 21:20
@guarzo
guarzo merged commit e453275 into main Aug 5, 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