-
Notifications
You must be signed in to change notification settings - Fork 536
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
Make context reload manual, and freeze context on incompatible or forced upgrade #3478
Comments
ghost
added
the
triage
label
Sep 2, 2020
ghost
added
the
triage
label
Sep 3, 2020
ghost
removed
the
triage
label
Sep 8, 2020
it is possible we can leverage the existing behavior of closing the container rather than closing the context only. |
anthony-murphy
added a commit
that referenced
this issue
Oct 12, 2020
anthony-murphy
added a commit
that referenced
this issue
Oct 20, 2020
This event is needed in versioning scenarios, as a host may not want to reload context on the current page, they may instead want an alternate flow, like closing the container, and forcing a page refresh. Changes: Add contextDisposed event. Add previous code details to both contextDisposed and contextChanged. Handling for closed container on context reload path. Move code loading into context to more cleanly bind a context to a specific code detail Add and improve tests to cover context disposed, and closing container on context dispose related #1281 related #3478
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context reload is currently a complicated process to expose and consume. In many cases it will require a refresh of the page hosting the container. If we are not very careful this could result in data loss.
Rather than building complicated detection, interception, and cancellation logic, i propose we change the fundamental mechanism here. Rather than automatically closing and reloading the context, we should split this is two.
On an incompatible code proposal an event should be fired, and the current context should become readonly, no longer accepting any local or remote operations.
There should be a mechanism the host can call at this point to manually reload the context, or ask the user to refresh the page. Ideally, we can detect this in a way to prevent data loss, such that no pending changes are accepted that won't be able to be round tripped.
For backwards compatibility we should maintain the current behavior with the NullRuntime to a real runtime.
The detection method that the context has been frozen should also be extensible, as there are other cases, like server side file operations (delete, restore, ...) that could also result in the context needing to be frozen
The text was updated successfully, but these errors were encountered: