Repository navigation
Prevent stale saves from restoring deleted repeater items - #381
Open
PercolatingStudio wants to merge 2 commits into
Open
PercolatingStudio wants to merge 2 commits into
PercolatingStudio wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #347.
Reproduction on the published 3.2.5 ZIP
On PrestaShop 9.1.4, create a FAQ block with two questions and open the same editor in two tabs. Select a question in the second tab. Delete it in the first tab and wait for the deletion to finish. Save from the second tab: the stale request succeeds and the deleted question returns after reloading. Waiting for the normal single-tab refresh already clears the selection; the second-tab test demonstrates the remaining defect on current main.
Fix
The repeater add action already persists new items before editing, so the update action now rejects a missing key without saving. The editor shows a message and refreshes the block selection if the response still applies to the current item and shop/language/zone. Normal saves still update existing keys. This change does not add transactional locking for truly simultaneous writes or change how keys are assigned.
Thanks to @Daaaaad for the detailed report.
Validation
b47f0eba1d309d1fcf6aca344bba9de120f24e248bb49601742b6d20e36ecea5). Package/manifest checks, installations, and smoke tests pass on PrestaShop 8.2.7/PHP 8.1.33 and 9.1.4/PHP 8.5.0.git diff --checkpass.No merge or release requested by this PR.