Skip to content

fix(auth): tear down session-keeper WebView after cookie refresh - #44

Open
mihaimetal wants to merge 1 commit into
NUber-dev:mainfrom
mihaimetal:fix/ephemeral-session-keeper
Open

fix(auth): tear down session-keeper WebView after cookie refresh#44
mihaimetal wants to merge 1 commit into
NUber-dev:mainfrom
mihaimetal:fix/ephemeral-session-keeper

Conversation

@mihaimetal

Copy link
Copy Markdown

Summary

  • The hidden session-keeper WebView (loads music.youtube.com) was kept open permanently so cookies could be renewed every 20 minutes.
  • That leaves a full Music SPA WebContent process in RAM (~300MB+ on macOS), on top of the main tauri://localhost UI process — so a signed-in YTubic can approach a browser Music tab in memory.
  • Change: create the keeper only for each refresh cycle, snapshot cookies, then destroy it (including on failure). Next cycle spins a fresh one.
  • Periodic timer is unchanged (still every ~20 min, well inside Google’s ~2h extracted-cookie leash).

Why a separate PR (not folded into #41)

Tradeoffs

  • Short cold cost every 20 min (open webview → load → snapshot → close) instead of a permanent ~300MB resident process.
  • WebView profile on disk is unchanged; only the live window/process is torn down.

Test plan

  • Sign in, wait for first refresh (~20s after launch): Activity Monitor should show a Music/YouTube WebContent process briefly, then it should disappear
  • Leave the app running >20 min: library / playback still work (cookies renewed)
  • Failed refresh also tears the keeper down (no orphan process)
  • Sign-out still cleans up

Related

@mihaimetal
mihaimetal force-pushed the fix/ephemeral-session-keeper branch from 6c55a35 to 77aec35 Compare July 27, 2026 13:43
@mihaimetal

Copy link
Copy Markdown
Author

Rebased onto current main after 0.4.0 so this is a clean merge candidate against the release tree.

@mihaimetal
mihaimetal force-pushed the fix/ephemeral-session-keeper branch from 77aec35 to 972df1f Compare August 2, 2026 07:48
Spin up the hidden keeper only for the capture window on each renewal,
then destroy it so the SPA WebContent process is not resident between
cycles.
@mihaimetal
mihaimetal force-pushed the fix/ephemeral-session-keeper branch from 972df1f to 5961054 Compare August 2, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant