Repository navigation
fix(dashboard): preserve quota cutoff drafts during refresh - #7909
diegosouzapw merged 1 commit into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Verified this locally: checked out the branch, ran the new regression test ( One thing for the maintainer to reconcile before merge: PR #7921 lands a functionally equivalent fix for the same root cause in the same file (using a ref-based read of |
62cbbcd
into
cheaper-inference:release/v3.8.49
|
Merged — thanks @hydraxman! The wasOpenRef/seededConnectionIdRef gate is a clean fix for the QuotaCutoffModal snapping bug (#7889), and your PR landed before an equivalent internal one so the credit's yours. Nicely tested. (Merged on real CI green — a parallel monaco 0.56 dep bump had left our local validation box with stale node_modules, unrelated to this PR.) |
Co-authored-by: Bryan Nathan <bryan@users.noreply.github.com>
Co-authored-by: Bryan Nathan <bryan@users.noreply.github.com>
Summary
Problem
The cutoff modal seeded local draft state from
windowsandcurrentinside an effect that depended on both object references. Provider quota refreshes recreate those values, so an unrelated parent render reran the effect and replaced an operator's in-progress input with the persisted value or an empty string.Related Issues
Dev Design
QuotaCutoffModalnow receives the stable connection ID and tracks the previous open state and seeded connection. The effect keeps complete React dependencies, but only writes draft state on an open transition or connection-ID change. Save, reset, validation, provider defaults, persistence, and quota selection are unchanged.Alternatives considered were memoizing the parent props, which would leave the modal coupled to parent allocation behavior, and dropping effect dependencies, which would risk stale seed values.
Validation
10back to2npx vitest run --config vitest.config.ts tests/unit/ui/quota-cutoff-modal-draft-reset-7889.test.tsx— 1 passednpm run test:vitest:ui— 960 passed; 3 unrelatedburn-rate-chartfailures reproduced unchanged on the base revisionnpm run typecheck:corenpm run check:dashboard-typecheck— within the frozen baselinenpm run check:file-sizenpm run check:complexitynpm run check:changelog-integritynpm run check:test-discoverynpm run test:coverage— not run locally; remote CI owns the full coverage gateTests Added Or Updated
tests/unit/ui/quota-cutoff-modal-draft-reset-7889.test.tsxCoverage Notes
The regression exercises the state-lifetime branch added by this change. No production path is left without focused coverage.
Reviewer Notes
This is limited to modal draft initialization. It does not change API payloads, persisted cutoff values, or routing behavior.