Repository navigation
feat(browser): ask before closing an idle session browser - #995
Merged
Merged
Conversation
The reaper closed a headless browser no pane showed after five minutes unused, so working in another session for five minutes lost the page, its tabs and its login. It now marks the browser idle in its state and the window asks with a toast: Close closes it, Keep open (or a swipe) keeps it for another idle window, and unanswered it stays open and is not asked about again. Any use withdraws the question, and a window that reopens reads it from browser.Running. Three reaper tests change because the contract changed: they asserted the browser closed on its own.
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.
Summary
The reaper closed a session's headless browser after five minutes with no pane showing it and no use. Working in another session or project for five minutes was enough to lose the page, its tabs and its login, without the person ever choosing that.
Now the reaper never closes a browser on its own:
idleon the browser's state (browser-state, andbrowser.Runningfor a window catching up), once.browser.Close. Keep open, or swiping the toast away, calls the newbrowser.Keep: the browser stays and is asked about again after another idle window.ui.ToastgainsOnDismiss, sonner's: it runs on a swipe out, not on its buttons, its timer orDismiss.Headed windows are still never asked about, and closing the card still closes the browser.
Contract
api.BrowserState.Idleandbrowser.Keep(SessionIDOptions) None;contract.goldenupdated.TestIdleReaperClosesUnusedandTestReaperLeavesAWatchedBrowserUntilDetachchange because the contract changed: they asserted the browser closed on its own.docs/ceilings.mdanddocs/browser-tab.mdmove with it.Test plan
Runningcarries the question.OnDismissand buttons andDismissdo not.-shotwith-toasts idlein dark and light.native/gofmt, vet and tests.