fix(mini-player): closing hides the window, so reopening never lands on a dead webview - #726
Conversation
…on a dead webview
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: InstaZDLL/WaveFlow/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughLe mini-lecteur garde la fenêtre principale visible. Sa fenêtre est masquée, puis réutilisée. Le décodage des clips, le canvas et la couverture animée sont suspendus lorsque la fenêtre est masquée ou sans focus. ChangesCycle de vie du mini-lecteur
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant TauriWindow
participant MiniPlayer
participant CanvasStage
TauriWindow->>MiniPlayer: signale la perte ou la reprise du focus
MiniPlayer->>CanvasStage: désactive ou réactive le canvas
MiniPlayer->>MiniPlayer: suspend ou reprend le décodage des clips
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
What happens
Opening the mini-player after the track changed while it was closed shows "No track playing", with the engine playing. Opening it again fixes it, so it looks like every other opening fails.
Evidence gathered on the failing window:
invoke("player_get_state")answersplaying <title>: the engine knows the track, the mini never got its startup snapshot.PostMessage failed … 0x80070578 - Invalid window handleonce per mini close, and the main window's console printedCouldn't find callback id— replies reaching a webview that did not ask.The mini was destroyed on close and re-created under the same
minilabel. The working explanation is that the new webview's first replies were delivered to the old one's dead handle. It is an explanation that fits every observation, not one read in Tauri's source, so this needs confirming on screen before merging.The fix
openMiniPlayershows the same window again (it already had that path). Nothing is re-created, so nothing can address a dead handle; reopening is instant and the mini is already up to date.openMiniPlayerfocuses it).core:window:allow-hideadded to the capability: it was never granted.A behaviour made explicit
openMiniPlayerended withmain.hide(), documented as "hides the main window". The permission was never granted, so that call has always failed and the main window has always stayed visible. That is the behaviour people know, so the call is removed andui.mdnow says the main window stays visible.Checks
bun run typecheck, eslint, prettier, local review clean. Frontend plus one capability line; the capability change needs a restart oftauri devto take effect.To verify on screen
PostMessage failedlines should no longer appear.Summary by CodeRabbit
Nouvelles fonctionnalités
Améliorations