Repository navigation
Conversation
Applying a draft deferred the canonical element's change-tracking upserts to app termination. Queue workers and the MCP stdio server don't terminate between jobs or calls, so the rows were only written when the process exited, and they were written even when applying the draft rolled back. DB::afterCommit() keeps the upserts outside the save transaction, as #10662 needs, and drops them on rollback. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
Triggers collected during a queue job stayed in the worker's memory until it exited. A batched resave ends its bulk op in a later job, which can run on another worker and replay without them. Pending triggers are now stored when each non-sync job finishes or throws, and after each MCP stdio response. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
The Deprecator is request-scoped, and a queue worker forgets scoped instances before each job, so warnings logged by every job but the last were dropped before the worker terminated. They're now stored when each non-sync job finishes or throws, and after each MCP stdio response. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
This branch has not been deployed
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.
Description
Three places stored per-request state in
app()->terminating().queue:workand the MCP stdio server don't terminate between jobs or calls, so that state was written late or lost. 5.x ran each queue job in its own process, so its after-request hooks ran when the job ended.Deprecatoris request-scoped, and the worker forgets scoped instances before each job, so warnings from every job but the last were dropped.Evidence
app()->terminate(); no bulk op or deprecation rows after a queued job finished.After:
UpdateCanonicalElementTest,BulkOpDeferralsTestandDeprecatorTestcover each, and fail on the old code.