Posts saved before v0.10.0 can lose or misread saved remote data

Open
#879 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
php, wordpress
Domain
backend, frontend

Research direction

Read issue #867 for background, then trace how saved remote data is read in the editor and in PHP. Compare the old and current formats, including custom query output and the loading case described here. Done means both sides detect old data consistently, all listed cases work, and current saved data remains unchanged.

Written by the indexing model from the issue text.

Description

Description

Posts saved before v0.10.0 store remote data in an older format. If such a post hasn't been saved since:

  • In the editor, saved values can show as empty until fresh data loads.
  • A text field named result is split into characters in the editor.
  • A row with fields named both result and uuid isn't converted in the editor.
  • With an object or array field named result, visitors see the saved content instead of live data.
  • Changing focus away from a query input and saving while data is still loading leaves visitors on saved content and empties the saved row values.

Impact

Narrow, and limited to these old posts. We haven't had a report of it. These were checked with hand-built data, not posts from an old install.

Notes for a fix

  • Current saved data, including output from custom queries, should keep working unchanged.
  • The editor and PHP should detect the old format the same way.
  • Keeping old values in the editor with result.result ?? result made one case worse: saving during loading lost the label and formatting on the front end.

More background is in #867.

Dominant language
PHP
Stars
86
Forks
14
Avg merge
1d 5h
Merged PRs (30d)
23

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/remote-data-blocks

All issues in Automattic/remote-data-blocks

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.