Repository navigation
Cover the two src/auth paths #167 left untested — main is red (#145) - #171
Merged
Merged
Conversation
PR #167 merged with a failing CI run. The SPA coverage gate holds src/auth to 100% lines/statements and 95% branches; the new cookie-based session code landed at 95.45% lines and 93.33% branches, so main has been red since, and every open PR inherits it through the merge commit its checks run against. Both gaps are real paths, not gate noise: - AuthContext.tsx:69-72 — the branch that ADOPTS a restored session. Every existing case starts either already-authenticated or with restoreSession resolving false, so the success half of the #145 load-time bootstrap — the whole point of moving the refresh token to a cookie — never executed. The new test has the mock store a Manager token before resolving, mirroring what the real client does, so it also pins that the provider derives the role from the TOKEN rather than from the boolean. - tokenStore.ts:34 — the catch in purgeLegacyTokens. Safari private mode and hardened profiles throw from the storage API instead of returning null, and this runs at startup, so an uncaught throw takes the app down before first paint. src/auth goes to 100% lines/statements and 97.77% branches. No production code changed.
This was referenced Jul 23, 2026
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.
main is currently red and has been since #167 merged. Its CI run (29985968157) failed the web job; the .NET job passed, which is probably why it slipped through.
This blocks every open PR, not just main: GitHub runs PR checks against the merge of head and base, so any branch — even one with zero
web/changes — now reports the same failure. That's how I found it, on #168.The two gaps
Both are real paths, not gate noise.
AuthContext.tsx:69-72— the branch that adopts a restored session.Every existing case starts either already-authenticated or with
restoreSessionmocked to resolvefalse, so the success half of the #145 load-time bootstrap never executed — the exact path moving the refresh token into a cookie was built to add. The new test has the mock store a Manager token before resolving, mirroring what the real client does, which also pins that the provider derives the role from the token rather than from the boolean: hard-codingAdminorWorkeron this path fails it.tokenStore.ts:34— thecatchinpurgeLegacyTokens.Safari private mode and hardened profiles throw from the storage API rather than returning
null. This runs at startup, so an uncaught throw takes the app down before first paint.Result
src/auth→ 100% lines/statements, 97.77% branches. 393 tests pass (was 391). No production code changed — tests only.Worth deciding separately: #167 merged with a red run. If branch protection is meant to prevent that, it isn't configured to.