Skip to content
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

An error while saving can leave Open MCT in an unrecoverable state #5802

Closed
2 of 7 tasks
akhenry opened this issue Sep 22, 2022 · 2 comments
Closed
2 of 7 tasks

An error while saving can leave Open MCT in an unrecoverable state #5802

akhenry opened this issue Sep 22, 2022 · 2 comments

Comments

@akhenry
Copy link
Contributor

akhenry commented Sep 22, 2022

Summary

If an error occurs while saving from edit mode, the transaction is ended meaning that edit mode is active, with unsaved changes, but no active transaction.

Expected vs Current Behavior

If an error occurs while saving the user should be able to try the save again. Although recovery is impossible in some cases (a conflict is probably impossible to recover from at this point), there have been edge cases observed where recovery was possible where the save error was due to transient network issues.

I believe that the desired behavior would be to move the line this.openmct.objects.endTransaction(); from the finally block to the end of the then block. The promise chain would probably be clearer using async/await if you felt inclined to refactor it.

Steps to Reproduce

  1. Edit a display layout
  2. Open the network tab in Chrome dev tools
  3. Make some changes to the display layout (you can just move something around)
  4. In the "Throttle" dropdown in the network tab select "offline"
  5. In the display layout, click "Save and Finish Editing"
  6. Observe that an error is displayed.
  7. In the "Throttle" dropdown in the network tab select "no throttling"
  8. In the display layout, click "Save and Finish Editing" again.
  9. Observe that the Save modal dialog appears and never disappears. The save never completes.
  10. The following is observed in the JavaScript console:
vue.min.js?8f59:6 TypeError: Cannot read properties of null (reading 'commit')
    at Editor.save (Editor.js?75c1:62:1)
    at a.saveAndFinishEditing (BrowseBar.vue?5e06:331:1)
    at Be (vue.min.js?8f59:6:11387)
    at HTMLLIElement.n (vue.min.js?8f59:6:13150)
    at Qr.o._wrapper (vue.min.js?8f59:6:48794)

Additional Test Instructions (to see if this issue exists in notebooks)

  1. create a notebook
  2. Open the network tab in Chrome dev tools
  3. In the "Throttle" dropdown in the network tab select "offline"
  4. Make some changes to the notebook (adding entries, editing entries, deleting entries, modifying properties)
  5. Observe errors in console
  6. In the "Throttle" dropdown in the network tab select "no throttling"
  7. Make more changes to the notebook
  8. Reload Open MCT to see if all changes were retained

Environment

  • Open MCT Version: 2.0.5 (but I believe it exists in master as well)
  • Deployment Type: devsim

Impact Check List

  • Data loss or misrepresented data? Results in loss of user data.
  • Regression? Did this used to work or has it always been broken?
  • Is there a workaround available?
  • Does this impact a critical component?
  • Is this just a visual bug with no functional impact?
  • Does this block the execution of e2e tests?
  • Does this have an impact on Performance?

Additional Information

@akhenry
Copy link
Contributor Author

akhenry commented Oct 6, 2022

@akhenry to test

@akhenry
Copy link
Contributor Author

akhenry commented Oct 6, 2022

Verified fixed.

There is a new issue, non blocker though. I will open another ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants