-
Notifications
You must be signed in to change notification settings - Fork 32
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
update collision should show a better error #6366
Comments
Technically this could be detected by the JS. It's just not clear to me where and how it should be detected. The code before was in autoSave, and the refresh was forced with an alertText. We could do something similar catching a specific SRException and showing an alert. However, I don't understand the flow of the data at that point. You would need to know that you are in the same simulation, for example. If you flesh out the UI part and how it is to be called, I can link it up to the request infrastructure. |
@moellep LMK when you want to work on this. |
This problem keeps coming up for users who have the simulation open in multiple tabs, or on a home computer. How about handling this on the client in handleSRException, so the current browser refreshes with the correct data after a message, and editing can continue: self.handleSRException = function(...) {
//...
if (e.routeName == "serverUpgraded" && e.params
&& e.params.reason === 'invalidSimulationSerial') {
errorService.alertText(`
This simulation has been updated outside of this browser.
This page will refresh in 5 seconds.
`);
$timeout(() => {
window.location.reload();
}, 5000);
return;
} |
Actually, it would be better to show a "Refresh" button in the alert message, so the refresh is manual - that way a separate instance of the simulation wouldn't also automatically refresh. |
We could add a routeName invalidSimulationSerial. It would be simpler.
I think the automatic refresh is fine. That's what we did before. The window that has the correct serial, will not get the alert. If you work on the UI, I'll work on the backend and the test. |
I'm going to work on the UI now. I think we need a confirmation page for both the "version conflict" and the "server upgraded" message (it can be the same message). Something that warns the user that their recent change was not saved and the simulation will refresh now. Having a confirmation also prevents the same sim getting into an autoUpdate loop with both refreshing. Only the confirmed sim should be refreshed. |
I think we should have two different srExceptions, since they are different cases. The code then can differentiate the errors.
Have you seen this happen? It seems like the one in conflict won't be allowed to update so there won't be a loop. |
Here is an example where the loop could happen: |
Ah so there are changes being saved that aren't actually differences. |
I've seen many cases where scientists will have lots of browser tabs open, and make a change to a sim, and then see the "simulation already modified" message. Now that message is gone, and the incorrect "Server upgraded" message is shown, and they are kicked out of the simulation back to the simulation list.
Instead it should show a "simulation already modified" error, possibly with a link to refresh the window, or refresh the simulation automatically. Otherwise they lose all their context and can't return to the simulation they want.
The text was updated successfully, but these errors were encountered: