docs(payouts): write down the two invariants that keep pastes from vanishing - #125
Conversation
…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.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
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 downThe controlled textarea is what makes a rejected paste survive. It has no direct test and cannot cheaply get one:
appraiseLootonly rejects viaTriffError/EsiError, the ESI and triff clients are constructed insideaddAppraisedPoolActionrather than injected, andTRIFF_QUOTE_URLis 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 pastealready 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.tsx—defaultValueis safe, but only conditionallyInlineEditusesdefaultValue, the same pattern that lost the paste in the other two forms. It is safe here only because every action it wraps rejects byredirect()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
npm run typecheck— cleannpm run lint— clean, zero warnings (chore(lint): say why the header mark is an <img>, and clear the last warning #123 cleared the last one)npm run format:check— all files matchnpm test— 1083 passed (1083)npm run test:e2e— not run. Nothing rendered changed.