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

After update through API, editor shows old content #41

Closed
mrvdb opened this issue Dec 1, 2018 · 5 comments
Closed

After update through API, editor shows old content #41

mrvdb opened this issue Dec 1, 2018 · 5 comments
Assignees
Labels
bug
Milestone

Comments

@mrvdb
Copy link
Collaborator

@mrvdb mrvdb commented Dec 1, 2018

When updating a post through the API while also checking the editor on the website, the editor does not use the updated content which came in, but seems to be using a local browser storage entry draft...... to show the editable content.

Steps to reproduce the behavior (I have used the writefreely.el package):

  1. Create a post through the api as draft
  2. Got to the site, find the post and edit
  3. Do other things on site
  4. Post update through api
  5. Go back to post and edit

Editor will show initial content created in 1. or, if applicable any changes made in the editor in step 2. (but not published)

Expected behavior

Post should be updated according to latest update through api. It looks as if the local storage does not get invalidated properly.

Application configuration

  • Multi-user / open reg / federation enabled
  • latest git version
@thebaer thebaer added the bug label Dec 1, 2018
@thebaer
Copy link
Member

@thebaer thebaer commented Dec 1, 2018

Thanks for the report -- definitely need to fix this.

We'll need to keep track of the last time the draft in the editor was modified (in localStorage), and then compare it with the Updated time on the post when loading the editor. If the published post was updated since the draft was last modified, then we'll erase the draft in localStorage and load the most recent post data from the server.

@cjeller1592 cjeller1592 added this to the 1.0 milestone Feb 26, 2020
@wiwie
Copy link

@wiwie wiwie commented May 5, 2020

I am not sure whether this is the same issue I am experiencing: When editing a post on my phone and saving the changes, I can view the changed post on any machine, but when editing on my laptop I see an outdated version. When then editing on the phone again, the correct (changed) version is shown.

@thebaer thebaer self-assigned this Jun 4, 2020
@thebaer
Copy link
Member

@thebaer thebaer commented Jun 4, 2020

@wiwie Right, since edits are stored locally on your device until you publish, your laptop is loading those local edits instead of the most up-to-date post content. I'm working on fixing this now.

@wiwie
Copy link

@wiwie wiwie commented Jun 4, 2020

ok, cool!

I recently read somewhere, that write.as stores some things locally in the browser session to facilitate a higher level of data security. Is the aspect of editing a draft not connected to that?

@thebaer
Copy link
Member

@thebaer thebaer commented Jun 4, 2020

Draft editing is connected that -- changes to posts are stored in the browser, which is why things can get out of sync across devices.

@thebaer thebaer modified the milestones: 1.0, 0.13 Jun 11, 2020
@thebaer thebaer closed this in #324 Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.