Skip to content

🐛 v3: finish an update under the lock, and on the first 3.0 run too - #121

Merged
gfazioli merged 2 commits into
v3from
fix/v3-codex-review
Oct 6, 2026
Merged

gfazioli merged 2 commits into
v3from
fix/v3-codex-review

Conversation

@gfazioli

@gfazioli gfazioli commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

From the Codex review of v3 (gpt-6-sol, high), after #119.

  • [P2] The update's own work ran outside the completion boundary. The options delta and plugin/updated.php ran after the version was stored and the lock released: a failure there was never retried, and another request could proceed before it ended. Migrator::migrate() now takes it as a callback, run under the lock after the migrations and before the version moves; a throw is recorded as the failure and the next run finishes the update again.
  • [P1] The first 3.0 run of a site updated from 2.x skipped plugin/updated.php. With no stored version it was taken for an installation. It now runs, with $previousVersion null; only a first activation skips it.

Proof: composer test 257 tests / 700 assertions; migrations-live-smoke.sh 33 checks green, including the new one on the real 2.1.0 → 3.0 upgrader path (plugin/updated.php runs on the first 3.0 request).

Refs #40

…0 run too

From Codex's review of v3 (gpt-6-sol):

- The update's own work (the options delta, plugin/updated.php) ran after the version was stored
  and the lock released: a failure there was never retried, and another request could go on
  before it ended. Migrator::migrate() now takes it as a callback, runs it under the lock once
  the migrations went through and before the version moves; when it throws, the failure is
  recorded and the next run finishes the update again.
- The first 3.0 run of a site updated from 2.x has no stored version, so plugin/updated.php was
  skipped as if it were an installation, and that update's work was lost. It now runs with
  $previousVersion null; only a first activation, which is an installation, skips it.

Proven live: migrations-live-smoke.sh, the 2.1.0 → 3.0 update through the real upgrader now
finishes with plugin/updated.php on the first 3.0 request (33 checks green).
…failure

From Codex's second round on v3: when setVersion() failed after the update's work ran, the
failure had already been cleared, so every public request found the update due and ran
plugin/updated.php again. The version is now stored before the failure is cleared, and a refused
write is recorded like any failure: retried by an administrator, at most every RETRY_AFTER.
@gfazioli
gfazioli merged commit 0f77f6c into v3 Oct 6, 2026
4 checks passed
@gfazioli
gfazioli deleted the fix/v3-codex-review branch October 6, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant