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

Spin up the hidden Music keeper only for the ~20s capture window on
each 20 min renewal, then destroy it so the SPA WebContent process is
not resident between cycles (~300MB+).
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