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

Persistence data plugin should take into account the object shape #9994

Closed
oandregal opened this issue Sep 18, 2018 · 3 comments · Fixed by #13951
Closed

Persistence data plugin should take into account the object shape #9994

oandregal opened this issue Sep 18, 2018 · 3 comments · Fixed by #13951
Assignees
Labels
[Package] Data /packages/data [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@oandregal
Copy link
Member

The persistence data plugin helps to persist parts of the state in between sessions. When the data persisted is an object (e.g. the preferences key in the editor, nux, or edit-post stores) new keys added to that object will be invalidated once the persistence mechanism retrieves old data from cache.

How to test

  • Clean browser application cache, check out master branch, and run Gutenberg.
  • Create a new branch and add some code that adds a new key to the preferences object whose value is true by default.
  • Execute that new branch.

Expected result is that the preferences object will have the new truthy value but instead it has the state retrieved from local storage (which doesn't have the new added key).

@oandregal oandregal added the [Type] Bug An existing feature does not function as intended label Sep 18, 2018
@oandregal
Copy link
Member Author

cc @aduth @youknowriad in case it is of any help, I ran into this while working on #9760

@youknowriad
Copy link
Contributor

This was working at some point, so I think it's a regression.

@aduth
Copy link
Member

aduth commented Sep 18, 2018

Could be related to #8341

@aduth aduth self-assigned this Oct 12, 2018
@aduth aduth added the [Package] Data /packages/data label Feb 18, 2019
@aduth aduth added the [Type] Regression Related to a regression in the latest release label Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Data /packages/data [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants