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

Updating revision number after saving #322

Closed
AlexanderPico opened this issue Jun 12, 2015 · 3 comments
Closed

Updating revision number after saving #322

AlexanderPico opened this issue Jun 12, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@AlexanderPico
Copy link
Member

At this point in the code:
https://github.com/wikipathways/pvjs/blob/master/lib/editor/editor.js#L185

You can grab the new revision number from the responseText, like so:

response.responseText

This will return a value, like 80291, that then needs to be passed to pvjs so that it knows what the current version is in order to support additional edits.

Doable?

@AlexanderPico
Copy link
Member Author

New revision number is being extracted, printed to console and passed here https://github.com/wikipathways/pvjs/blob/master/lib/editor/editor.js#L198, but pvjs doesn't seem to be picking it up.

Steps to test:

  1. make an edit
  2. save and close
  3. reopen editor (without refreshing) and make another edit
  4. save and close
  • Outcome: error--changes not saved because revision number is out of date
  • Expected: successful save

@AlexanderPico AlexanderPico reopened this Jun 19, 2015
@ariutta
Copy link
Member

ariutta commented Jun 22, 2015

To solve this, we need to follow the pvjson through being created, updated in editor and then updated after saving. We have multiple ways we're storing the pvjson, partly because we don't have the pvjson-to-GPML converter working yet. So for now, we just need to make sure we're updating the right pvjson. For long term, we should be sure we only have a single active pvjson and either 1) a single "original" pvjson before the edits or 2) a revision history that allows for "undo" functionality.

@AlexanderPico
Copy link
Member Author

Fixed in 2.4.26

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

No branches or pull requests

2 participants