Repository navigation
fix(migration): add the push broker schema to upgraded projects - #13859
Merged
Merged
Conversation
Contributor
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
ArnabChatterjee20k
approved these changes
Sep 23, 2026
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.
What does this PR do?
migratefails on every project upgraded from 2.2.0:pushLedger(the MQTT push broker's message ledger, #13372, renamed in #13815/#13848) is a new collection inapp/config/collections/common.php, so it belongs to the console and to every project. New projects and the console database get it on creation, but nothing creates it for existing projects. V25 then iterates the configured collections inforEachDocumentand throws on the missing table, which aborts the migration for that project.V25 now creates
pushLedgerwhen it reaches it inmigrateCollections, through the existingcreateCollection()helper, which is a no-op when the collection already exists, so re-runningmigratestays idempotent.The same PR added
sequence,qosandexpirytotopicswithout a migration, so upgraded projects had no such columns and the Appwrite push adapter'sincreaseDocumentAttribute('topics', $topic, 'sequence', 1)would fail on them. V25 now adds the three attributes totopicstoo.Also removes a
strtotime(null)deprecation inV25::predatesMigration()that the existing unit test triggered.Found while running the 2.3.0 upgrade gate (2.2.0 install with seeded data → 2.3.0 image →
migrate). Blocks 2.3.0; it needs to land on2.3.xtoo (cherry-picked into #13857).Test Plan
V25Test::testAddsPushBrokerSchemaToProjectFromPreviousRelease: a Memory-adapter database shaped like a 2.2.0 project (nopushLedger, no topicsequence/qos/expiry), runs V25 twice. Fails onmainwithUtopia\Database\Exception\NotFound: Collection not found, and with only the ledger fix onFailed asserting that an array contains 'sequence'; passes with both.tests/unit/Migration: 17 tests pass, no deprecations.migratetwice: both runs exit 0,_1_pushLedgerand_1_topics.{sequence,qos,expiry}exist, seeded users, rows, files, topics and providers read back unchanged.