-
Notifications
You must be signed in to change notification settings - Fork 28.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notebooks emit a content change event when switching profiles #180823
Comments
This can happen if a change to the notebook and a change of the profile happened fast enough that we did not have a chance to complete the backup of the notebook to disk. In that case there is really nothing we can do to prevent data loss on shutdown and have to prevent it from happening. To clarify, is that what was happening here? Very fast profile switch after making a notebook dirty? |
I can reproduce easily. @rebornix this is maybe notebooks could still improve next month. When I debug this I see an issue that makes the backup service bring up a dialog like this. Let me clarify what happens. Normally, the backup service would not complain about a missing backup, when a backup exists that matches the content version of the notebook (which we track internally). Here, a backup actually exists for that content and thus I was wondering why the dialog appears anyway. Looks like, when I change profiles, the notebook component emits a content change event which will trigger a call to
I think originating from a Given this content change event, the working copy backup handler will try to perform another backup, even though the content did not change. And since that fails (because in the new profile there is no notebook extension installed), the backup handler will complain when you try to exit or reload. Is it possible to not emit the content change event here when profiles change? |
I have updated the title, I think the gist is that there is a content change event when you switch to a profile that does not have the NB extension installed and that causes all kinds of issues (including #180822) |
@bpasero thanks for the analysis!
This is a bit unexpected and should be fixed. At the same time, I agree that we shouldn't avoid content change when switching profiles. |
This is an interesting issue. After switching to a new profile, which lacks of the GitHub issue notebook extension, we can't set a proper language on the cell anymore. The code cell used to have language "GitHub-issues" but now it's set to plain text as a fallback, Thus leading to the language update and triggering backup. It's not trivial to fix and once we have #180514, this should not happen. Let's track it over there. |
@rebornix but why is a language change considered a content change? is the language part of the backup? |
Testing #180767
Before the reload occurred, this error blocked it:
The text was updated successfully, but these errors were encountered: