Skip to content

buzz-db: fix main (renumber the function drop to 0094, update_channel test call) - #9616

Merged
TheSentinel454 merged 2 commits into
mainfrom
elrond/renumber-0094-plain-sql-functions
Nov 17, 2026
Merged

TheSentinel454 merged 2 commits into
mainfrom
elrond/renumber-0094-plain-sql-functions

Conversation

@TheSentinel454

@TheSentinel454 TheSentinel454 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Main has two migrations numbered 0093:

The file names differ, so GitHub showed no conflict between the PRs. sqlx applies the first version-93 migration and then rejects the second as a changed migration 93. Every migrate run on main fails, including relay startup with auto-migration on.

This PR moves #9598's migration to 0094:

  • git mv migrations/0093_drop_plain_sql_functions.sql migrations/0094_drop_plain_sql_functions.sql. The SQL is unchanged.
  • embedded_migrator_contains_consolidated_initial_schema now expects 94 migrations, with the function drop at version 94.
  • The Postgres test is renamed to migration_0094_drops_plain_sql_functions. It finds the migration by description, so its logic is unchanged.
  • docs/trigger-retirement-deployment.md now names 0094.

#9560's 0093 keeps its number. It reached main first and may already be applied on deployments that auto-migrate.

Second break on main: update_channel call sites

Main's buzz-db lib tests also stopped compiling. #9581 added a sender argument to update_channel, and #8320's cross-community test (deletion.rs) landed in parallel with the old three-argument call. This PR passes the channel creator as the sender. The test only renames an open channel, so the private-to-open rule does not apply.

Deployments

No deployment has applied #9598's 0093: no image built from main after #9598 has rolled out yet. A database that applied #9560's 0093 applies 0094 next. Do not promote any image built from 4e8f8365 (the #9598 merge) or later until this PR merges.

What got simpler

Nothing. This is a renumber and a test call fix only.

🤖 Generated with Claude Code

#9560 and #9598 both added a migration 0093 with different file names, so
GitHub showed no conflict. Main now embeds two version-93 migrations. sqlx
applies the first and then rejects the second as a changed migration 93, so
every migrate run fails.

Keep #9560's 0093_push_gateway_installation_platform.sql, which reached main
first and may already be applied, and move 0093_drop_plain_sql_functions.sql
to 0094. Update the embedded-migrator asserts, the migration test name and
the deployment runbook to match.

Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Luke Tornquist <tornquist@squareup.com>
@TheSentinel454
TheSentinel454 requested a review from a team as a code owner November 17, 2026 18:47
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated, security-focused review generated by Codex.
Use it as a supplement to human review; false positives are possible.

Scope

  • Exact PR diff: 4e8f836576c457c2fd51a1a0072240fd7d95aecf...60acd475d0d3d36cda274c4c7a24eeb22a5f0523
  • Model: gpt-6.1-sol

💡 Click "edited" above to see earlier reviews for this PR.


Review Summary

Overall Risk: NONE

No concrete security, correctness, or reliability findings were identified in the authorized PR range. The migration renumbering and test call updates are consistent with surrounding code.

Findings

No concrete security, correctness, or reliability findings were identified.

Notes

  • Review was limited to read-only source and history inspection. Builds and tests were not run, as instructed.

Generated by Codex Security Review |
Requested by: @TheSentinel454 |
Workflow run

#9581 added a `sender` argument to `update_channel`. #8320's
cross-community test landed in parallel and still calls it with three
arguments, so main's buzz-db lib tests no longer compile. Pass the channel
creator as the sender. The test only renames an open channel, so the
private-to-open rule does not apply.

Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Luke Tornquist <tornquist@squareup.com>
@TheSentinel454 TheSentinel454 changed the title buzz-db: renumber the plain SQL function drop to 0094 buzz-db: fix main (renumber the function drop to 0094, update_channel test call) Nov 17, 2026
@github-actions github-actions Bot added codex-security-review-current The posted Codex security review matches its recorded range. and removed codex-security-review-current The posted Codex security review matches its recorded range. labels Nov 17, 2026
@TheSentinel454
TheSentinel454 enabled auto-merge (squash) November 17, 2026 19:13
@TheSentinel454
TheSentinel454 merged commit e894d75 into main Nov 17, 2026
88 of 90 checks passed
@TheSentinel454
TheSentinel454 deleted the elrond/renumber-0094-plain-sql-functions branch November 17, 2026 19:28
TheSentinel454 added a commit that referenced this pull request Nov 17, 2026
## Summary

Main's user content cleanup still calls the SQL function
`community_deletion_lock_key`. Migration `0094` (#9598) drops it. On any
database at `0094`, every user-deletion content batch fails with `42883
function community_deletion_lock_key(uuid) does not exist`.

#9363 added this caller after #9396 moved the key to Rust. This PR binds
the Rust-built key with `hashtextextended($1, 0)`, as every other caller
does.

- `content_batches/execute.rs`: the batch's exclusive advisory lock uses
the Rust key.
- `content_batches/safety_postgres_tests.rs`: the test blocker takes the
same lock the same way.
- `docs/trigger-retirement-deployment.md`: builds from #9363 up to this
PR are not valid stops before `0094`.

Rebased onto main `e894d75d`. The renumber and the `update_channel`
test-call fixes this PR first carried are already on main through #9616,
so they are gone from this PR.

Deployed relays are unaffected: the deployed build predates #9363.

## Tests

The 17 `user_deletion::content_batches` PostgreSQL tests fail on main at
`0094` with the error above. This PR makes them pass.

## What got simpler

One fewer SQL-side copy of the lock key. Every caller now builds the key
in Rust.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Luke Tornquist <tornquist@squareup.com>
Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
wpfleger96 added a commit that referenced this pull request Nov 17, 2026
…e-recovery

* origin/main: (60 commits)
  Clean up account records and refresh member lists (#9364)
  perf(mobile): save own thread interest once per unread catch-up (#9614)
  buzz-db: fix main (renumber the function drop to 0094, update_channel test call) (#9616)
  feat(relay): name the agent whose add policy refuses a DM (#9601)
  buzz-db: drop the community_deletion_lock_key and profile_name_fields functions (contract) (#9598)
  fix(deps): clear chrono, humantime and zip advisories from the dependency policy (#9609)
  docs: define mobile diagnostic reporting (#9600)
  build(mobile): link iOS plugins through Swift Package Manager (#9597)
  feat(push-gateway): enroll Android installations and send FCM wakes (#9560)
  perf(mobile): cache and animate custom emoji in the iOS picker (#9479)
  fix(ios): end each bold or strikethrough run at its first closing marker (#9559)
  Apply the private-to-open rule in update_channel too (#9581)
  Add real content cleanup for users and agents (#9363)
  Keep transparency in mobile avatar photo crops (#9319)
  fix(mobile): read presence for a person shown again while still covered (#9595)
  buzz-db: check membership, agent-owner and channel references in app code (#9404)
  buzz-db: enforce five single-table guards in app writers (phase 1) (#8320)
  docs(mobile): add REVIEWING.md with mobile review principles (#9298)
  buzz-db: check workflow references in app code before FK retirement (#9399)
  fix(relay): enforce channel owner precedence (#9592)
  ...

Signed-off-by: Will Pfleger <wpfleger@block.xyz>

# Conflicts:
#	mobile/lib/features/channels/channel_actions_sheet.dart
#	mobile/lib/shared/read_state/read_state_manager.dart
wpfleger96 added a commit that referenced this pull request Nov 18, 2026
…c-spec-mobile

* origin/main: (37 commits)
  buzz-db: drop the five single-table guard triggers (BUZZ-318 phase 2) (#9398)
  push-gateway: lock expired installations before reaping (#9627)
  Retire the 0032 roster trigger in migration 0095 (#8696)
  fix(db): hard-delete superseded relay-signed lists (#9586)
  Add community-scoped user and agent profile cleanup (#9580)
  fix(sdk): timestamp channel messages with millisecond offsets (#9548)
  Check product_feedback's community in the writing transaction (#9608)
  buzz-db: stop calling the dropped lock-key function in SQL (#9615)
  Clean up account records and refresh member lists (#9364)
  perf(mobile): save own thread interest once per unread catch-up (#9614)
  buzz-db: fix main (renumber the function drop to 0094, update_channel test call) (#9616)
  feat(relay): name the agent whose add policy refuses a DM (#9601)
  buzz-db: drop the community_deletion_lock_key and profile_name_fields functions (contract) (#9598)
  fix(deps): clear chrono, humantime and zip advisories from the dependency policy (#9609)
  docs: define mobile diagnostic reporting (#9600)
  build(mobile): link iOS plugins through Swift Package Manager (#9597)
  feat(push-gateway): enroll Android installations and send FCM wakes (#9560)
  perf(mobile): cache and animate custom emoji in the iOS picker (#9479)
  fix(ios): end each bold or strikethrough run at its first closing marker (#9559)
  Apply the private-to-open rule in update_channel too (#9581)
  ...

Signed-off-by: Will Pfleger <wpfleger@block.xyz>

This branch was previously deployed

1 inactive deployment
codex-review — 60acd475 Deployed Nov 17, 2026 by TheSentinel454 via Run Codex Security Review #15747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex-security-review-current The posted Codex security review matches its recorded range.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants