Repository navigation
feat(app): offer a restart when an update changes where data is kept - #216
Draft
ehennestad wants to merge 1 commit into
Draft
ehennestad wants to merge 1 commit into
ehennestad wants to merge 1 commit into
Conversation
A session started before an update looks for its data where the new code expects it, and the warning for that only reaches the command window on the next path lookup. An open app can sit idle for days. RestartMonitor checks once a minute whether the code or the data has moved to another layout than the session started with, and the app then asks once whether to restart. The check is on the layout versions, so an ordinary commit in a checkout does not trigger it. The default answer is Later, because the dialog opens while the user can be typing. nansen.restart reset the session even when the user decided against quitting, for example with tasks running. It now stops if the app is still open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
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.
Problem
A session started before an update looks for its data where the new code expects it. The warning for that reaches the command window only, and only on the next path lookup. An open app can sit idle for days.
Change
nansen.internal.user.RestartMonitorcalls a check once a minute. When the check returns true, the monitor stops and firesRestartNeeded, so the user is asked once. A check that throws an error counts as a check that found nothing.NansenUserSession.isRestartNeededis the check. It is true whenUserDataLayout.CURRENT_VERSIONorProjectFolderLayout.CURRENT_VERSIONdiffers from the value the session started with, and when the version stored with the user data is later than the session started with, which means that another MATLAB migrated it. An ordinary commit does not change those numbers, so it does not trigger the prompt.nansen.Appasks throughMessageDisplay.ask, with the answersRestart NowandLater. The default isLater, because the dialog opens while the user can be typing.Restart Nowrunsnansen.restart.nansen.restartrannansen.quit, which resets the session even when the user decided against quitting, for example with tasks running, and the open app then lost its session. It now stops if the app is still open.The monitor only exists in an app started on code that has it. The update that brings in this PR relies on the command window warning from #126.
🤖 Generated with Claude Code