SCT-401 - fix issue where losing connection results in user being unable to save #1571
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.
This scenario has been going on for years. A user logs in, does stuff, goes away for a while (or loses internet for a while), then returns to a disconnected kernel. After reconnecting or restarting the kernel, the user now can't save.
The reason for this was that there are two backend pieces that require their own state for KBase code to run. The kernel (where code gets executed, including app running and managing), and the server (where notebook/Narrative management gets done, including saving and loading).
Restarting the kernel does nothing to modify the server state. This change updates that so that both the kernel and server state get updated at the same time.
The real change is in
kbaseNarrative.js
. Now, when the kernel signals that its ready (on page load, or after a restart), 3 things happen:Previously, #2 and 3 were in separate responses to the same event, they're merged together to avoid a race condition (I'm not sure if that's ever been seen in the wild, but I think I've seen it once or twice if there's a very inconvenient network hiccup).