Skip to content
This repository was archived by the owner on Mar 2, 2019. It is now read-only.

Enhancement backups versioning#5

Open
indocomsoft wants to merge 13 commits intomasterfrom
enhancement-backups-versioning
Open

Enhancement backups versioning#5
indocomsoft wants to merge 13 commits intomasterfrom
enhancement-backups-versioning

Conversation

@indocomsoft
Copy link
Member

No description provided.

孙逸群 and others added 13 commits April 12, 2018 21:55
Specifications:
Local Version Recovery
This enhancement aims to curb the issue of lost data due to accidental closing of the tab or browser while editing. The app should use the client's browser's local persistent memory to keep track of what the user has in his code editor. In the case of an accident where the user forgets to save his work or closes his tab, when the browser returns to the page, the app will prompt the user that he has not saved his work before he left the page and display the locally saved version and the cloud-saved version side-by-side with a helpful visual diff. This is done by comparing the timestamps between the locally saved version and the cloud-saved version. It will only prompt the user in the case where the locally saved version has a later timestamp than the one on the server, signalling that something might have went wrong on the client-side. It will also allow the user to view both the current version tagged to his account and the local version on his browser so that the user can decide which one he wants to use.

Save History
This enhancement aims to allow users to return to previously saved versions of their code by keeping a history of their saved versions on the server. On the user's end, no additional action is required when saving his code. On the server side, the server will enqueue the newly saved version into a version history queue. This queue should have a fixed maximum size (10) so that we do not run into memory issues on the server. If the user saves when he already has 10 version histories, the earliest version history is deleted to make way for the new version. The user should be able to access any of the last 10 versions by accessing a dropdown menu on the coding page.

Implementation:
Local Version Recovery
We utilized the browser's localStorage, storing all changes and the
time at which it was saved locally. Also, wereturned an additional
savedAt field when retrieving the user's progress on the workspace page.
We will then check the difference in timestamps to determine if the
user should be aware that he has a local version that is saved later
than the one on the cloud, in the case that he wants to use it.
This is done in the form of a modal popup, allowing the user to see
the differences in the saved versions.

Save History
We added a new table in the database to allow us to save a user's
past versions. We also ensure that there is a maximum of 10 user
histories per assignment question in the database. The frontend
then uses the returned JSON data to populate a new side content tab
with the user's version histories. Also, the user is able to preview
the past version histories by hovering over the boxes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants