Repository navigation
test(settings): pin the coverage snapshot on failed saves and drop a dead ternary - #635
Merged
Merged
Conversation
Contributor
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 5 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #551
State on main (3413591), saveGlobalSettings in frontend/src/settings.ts:
let coverage = defaultCoverageChanged ? settings.default_coverage : (base?.coverage ?? settings.default_coverage). After the global PUT, loadedServiceConfigs is remapped to settings.default_coverage when defaultCoverageChanged, so base?.coverage already equals it (and the fallback covers a missing row). Removed; behavior-neutral.await api.updateConfig, and the card snapshot advances only inside the service.then, with failures restoring previousSnapshot. The two mutants from the review had no test.Tests (settings.test.ts, 'global coverage propagation' block): (1) a rejected global PUT leaves the coverage dirty and sends no service PUTs (kills 'global snapshot refreshed before the PUT resolves'); (2) a card coverage whose service PUT failed stays dirty and is resent next Save, then clears (kills 'card snapshot updated after a failed PUT').
These pin existing behavior, so they pass on main by design; the mutants were not re-run (jest cannot run offline here, CI is the authority). The ternary removal is verified by reading: the two branches are equal on every reachable path.
Scope: #539, #617 and the Save scope untouched.