Automattic / Automattic/cortext
Serialize saves to the same field
- Dominant language
- JavaScript
- Stars
- 51
- Forks
- 2
- Avg merge
- 3h 12m
- Merged PRs (30d)
- 8
Description
Editing the same field twice quickly can fire two apiFetch calls that land out of order, so the older value wins. The version map keeps the displayed value correct but doesn't control write order. You'd need fast select or relation toggles to overlap (typing is covered by the debounce), so it's unlikely and low priority.
**Proposed solution:** chain each field's save on the previous one's in-flight promise so they go out in order. Moving documents to core-data (#298) would also settle it, since saves for one record run through a single `saveEntityRecord` queue.
Contributor guide
Research direction
Start by tracing the field save path that issues the apiFetch calls and uses the version map. Reproduce overlapping fast-select or relation-toggle saves, then verify that each field's writes resolve in dispatch order and the older value cannot overwrite the newer one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100