Repository navigation
fix: discard orphaned macOS session instead of erroring silently - #117
Merged
Merged
Conversation
Zuno's macOS builds are ad-hoc signed, so the Keychain entry backing the session's encryption key becomes unreadable on every update. The old code treated that as NoEntry and minted a fresh key, then tried decrypting the existing session file with it — guaranteed to fail. That thrown error was swallowed by restoreSession's catch and reported as a plain sign-out, with the broken file left behind to repeat the failure on every later launch. load_encrypted_youtube_music_cookie now treats any failure past confirming the file exists as an orphaned session: delete the file, report no session cleanly, so the next login starts fresh instead of retrying dead bytes forever. Also walks the full source chain in proxy_http_request's network-failure logging (error_cause_chain) — reqwest's own Display only showed the top-level wrapper, hiding whether a failure was DNS, TLS, or connection level. Closes #116
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What and why
Zuno's macOS builds are ad-hoc signed (
apple_signing_identity: "-"in the release workflow), so the Keychain entry backing the encrypted session's AES key is scoped to a code signature that changes on every update. When the old key became unreadable,load_or_create_cookie_encryption_keytreated that as "no entry" and minted a fresh one, thenload_encrypted_youtube_music_cookietried decrypting the existing session file with the new key — an AEAD tag mismatch, guaranteed to fail.That decrypt error propagated up through
load_youtube_music_cookie, andrestoreSession's catch swallowed it into a plain "not logged in" — indistinguishable, from the user's side, from having never signed in. The broken file was never cleaned up, so every later launch repeated the exact same failure. This is the root cause of #116: cached library UI, but a session that silently died and can't come back on its own.What changed
load_encrypted_youtube_music_cookienow treats any failure after confirming the file exists (key unreadable, decrypt failure, invalid UTF-8) as an orphaned session: delete the file and report "no session" cleanly, instead of throwing. The next sign-in starts fresh instead of retrying the same dead bytes on every launch.proxy_http_request's network-failure logging now walks the full.source()chain (error_cause_chain) instead of reqwest's bare top-level "error sending request for url" — that wrapper was hiding whether a failure was DNS, TLS, or connection-level, which is exactly what's missing from Unable to login to youtube on mac os #116's log to diagnose the separateiframe_apifailure the reporter also hit.What this does not fix
The underlying ad-hoc-signing churn itself — that needs a real Apple Developer ID certificate + notarization, which is a release-pipeline/cost decision, not a code fix. This patch stops it from masquerading as silent data loss; it doesn't stop the churn.
How it was checked
cargo check— clean, no warningscargo test— 30/30 pass, including a new test forerror_cause_chaincfg-gated fix itself can't be exercised on this dev machine (no macOS target installed) — syntax/type-checked by inspection with explicit closure return types to remove inference ambiguity; CI's macOSrustjob is the first real build of itCloses #116