Skip to content

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

@oandregal

Description

@oandregal

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).

Metadata

Metadata

Assignees

Labels

[Package] Data/packages/data[Type] BugAn existing feature does not function as intended[Type] RegressionRelated to a regression in the latest release

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions