Skip to content

test(mobile): run push tests without a gateway dart-define - #9423

Merged
brow merged 1 commit into
mainfrom
fix-mobile-push-test-isolation
Nov 13, 2026
Merged

brow merged 1 commit into
mainfrom
fix-mobile-push-test-isolation

Conversation

@brow

@brow brow commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

A plain cd mobile && flutter test failed 11 push and notification tests on a clean checkout of main, while CI passed. Agents running the full suite kept reporting them as "pre-existing, also fails on main", which hides real regressions in the same files.

Root cause

Push is gated on the compile-time BUZZ_PUSH_GATEWAY_URL define (Env.pushGatewayConfigured, since #7261 configurable gateway made the gateway optional). Without it the app is a push-less build: readBuzzPushEndpointGrants() returns no grants and buzzPushLifecycleEnabled() is false. CI's mobile shards, just mobile-test and the lefthook pre-push lane (which runs just mobile-test) all pass --dart-define=BUZZ_PUSH_GATEWAY_URL=https://push.example; a bare flutter test passes nothing. Each of the 11 was checked against that:

  • notification_toggle_test (5 cases) and push_lease_revocation_outbox_test "hosted relay assertion": no endpoint grants without a gateway (Bad state: No element at the grant lookup, No endpoint grant exists for push lease tombstone).
  • push_bridge_test "reads and exposes persisted endpoint grants" and "debug enrollment carries the configured relay and gateway URLs": the bridge returns [] before calling native (Expected: an object with length of <1>, Actual: []).
  • push_bootstrap_test "default push requires relay capability" and "new community starts registration": the lifecycle is disabled, so registration never starts (Expected <1>, Actual <0>).
  • push_bridge_test "development push gateway matches the compiled configuration": a stale test. It expected a https://push.buzz.xyz default that #7261 configurable gateway removed from the app; under CI's define both sides equal push.example, so it could never fail there.

The same files pass on the same Mac with the define, so nothing is environmental. The Unexpected native call takePendingNotificationResponse log is unrelated noise: the toggle test's native mock didn't answer that call, which logs (and is caught) in CI too.

Fix

Tests get the gateway from a test hook instead of the define. Env.pushGatewayUrl becomes a getter over the compiled value with a @visibleForTesting debugPushGatewayUrlOverride (the same pattern as debugUriStreamOverride), and test/flutter_test_config.dart sets it for every test file. push_unconfigured_build_test sets it to '', so it runs in the main suite instead of being skipped there and run separately. CI, the Justfile, scripts/flake-check.mjs and the AGENTS/README check commands drop the define, so CI, just mobile-test, pre-push and a bare flutter test run the same thing.

I chose this over documenting a canonical command because the define can't be made automatic: flutter test has no config file for defines, so any doc fix still leaves the obvious command red. A test hook makes every invocation agree.

The stale test is replaced by one in the push-less file that binds the production read: with the override cleared, Env.pushGatewayUrl must equal the compiled BUZZ_PUSH_GATEWAY_URL. Now that CI compiles without the define, it fails if the app regains a built-in gateway default, which the old test never could. The toggle test's mock answers takePendingNotificationResponse with no pending response.

What gets better: one test mode everywhere, and the push-less tests run in every run. Nothing gets worse: production reads the same compiled value (the override is never set outside tests, and an aot-snapshot probe shows AOT still folds the getter to the compiled constant and drops push-only code when the define is absent), and every test still runs in the push-capable mode CI used before.

Validation

  • On a fresh origin/main worktree with the Hermit toolchain, a bare flutter test failed exactly these 11; the same files passed on the same machine with the define.
  • After the fix, the pre-push just mobile-check and just mobile-test (now a bare flutter test plus the recipe and secp256k1 checks) pass, with the push-less tests running instead of skipped. scripts/flake-check.test.mjs passes.
  • Falsifiability: re-adding a defaultValue to the compiled gateway fails the new no-default test, and removing flutter_test_config.dart brings back the other 10 failures.
  • Unrelated: an earlier full run also failed community_provider_test "discard orphan snapshots and image caches", which waits 500 ms for a background directory delete. The Mac was running other full suites at the time; the file passed 8 of 8 runs alone, with and without the define. It is not touched here.

Push behavior is gated on the compile-time BUZZ_PUSH_GATEWAY_URL define.
CI, `just mobile-test` and the pre-push hook pass it, but a plain
`flutter test` does not, so 11 push and notification tests failed for
anyone running the obvious command. One of them also expected a
push.buzz.xyz default that #7261 removed from the app; the CI define
hid that.

Tests now get the gateway from `Env.debugPushGatewayUrlOverride`, set for
every file in test/flutter_test_config.dart. The push-less build test
sets it to '' and runs in the main suite instead of a separate step, and
CI, the Justfile, flake-check and the docs drop the define.

Signed-off-by: Tom Brow <[email protected]>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
@brow

brow commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T22:49:41.116404Z b6de552 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: b6de552733

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@brow
brow marked this pull request as ready for review November 12, 2026 22:48
@brow
brow requested a review from a team as a code owner November 12, 2026 22:48
@brow
brow enabled auto-merge (squash) November 12, 2026 22:48
@brow
brow deployed to codex-review November 12, 2026 22:48 — with GitHub Actions Active
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 12, 2026
@github-actions

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: a314975ce7bf9aa00baebfef874b6e69474a95cf...b6de5527331ad347ca03ba1363d6e599edb28a62
  • 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. Production push configuration retains its compiled fallback, and the new override is assigned only by tests.

Findings

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

Notes

  • Review used read-only source, caller, test, CI, and history inspection. Builds and tests were not executed, as instructed.

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

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kyle reviewed the PR and the Nexus review-tracker notes and approved with no comments.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

@brow
brow merged commit 8f3f4e2 into main Nov 13, 2026
109 checks passed
@brow
brow deleted the fix-mobile-push-test-isolation branch November 13, 2026 00:19
bostonaholic added a commit that referenced this pull request Nov 13, 2026
Co-authored-by: mboston.Engineer <932d3b6ebea6cc83e091551ae46d1c7e7f8f7d0fa8e9cef5e6facc8544af413b@buzz.block.builderlab.xyz>

* origin/main:
  fix(mobile): require Builderlab consent for existing identities (#8823)
  feat(mobile): use HTTP/2 on iOS through app-wide URLSessions (#8897)
  fix(relay): publish a git push only when refs changed; check the protocol by refinement (#9425)
  fix(mobile): show shared chats under Solo (#9348)
  chore(release): release Buzz Desktop version 0.5.29 (#9456)
  feat(mobile): render messages with gpt_markdown 1.3.4 plusparse (#8945)
  fix(acp): bound observer retention by bytes (#7987) (#9436)
  Tune release codegen for faster/smaller binaries (#9434)
  feat(desktop): add dismissible banner pointing to the new buzz app (#9379)
  fix(mobile): keep publishing presence while the app is open (#9441)
  feat(mobile): share into Buzz from the iOS share sheet (#9433)
  fix(mobile): qualify every namesake mention and keep authored mention casing (#9325)
  fix(mobile): match browser GIF timing in the iOS reaction sheet (#9437)
  fix(mobile): play short-delay animation frames at browser speed (#9432)
  buzz-search: read profile names without the profile_name_fields function (#9397)
  buzz-db: build the community deletion lock key in Rust (#9396)
  fix(cli): pair for the active community, skip stopped desktops, accept a bare relay host (#9417)
  test(mobile): run push tests without a gateway dart-define (#9423)
  fix(mobile): never pop Home when archiving from channel settings (#9387)
  perf(acp): reduce observer CPU and lock overhead (#9381)

Signed-off-by: Matthew Boston <[email protected]>
bostonaholic added a commit that referenced this pull request Nov 13, 2026
…count-backfill

Co-authored-by: mboston.Engineer <932d3b6ebea6cc83e091551ae46d1c7e7f8f7d0fa8e9cef5e6facc8544af413b@buzz.block.builderlab.xyz>

* bostonaholic--agent-reply-count:
  fix(mobile): require Builderlab consent for existing identities (#8823)
  feat(mobile): use HTTP/2 on iOS through app-wide URLSessions (#8897)
  fix(relay): publish a git push only when refs changed; check the protocol by refinement (#9425)
  fix(mobile): show shared chats under Solo (#9348)
  chore(release): release Buzz Desktop version 0.5.29 (#9456)
  feat(mobile): render messages with gpt_markdown 1.3.4 plusparse (#8945)
  fix(acp): bound observer retention by bytes (#7987) (#9436)
  Tune release codegen for faster/smaller binaries (#9434)
  feat(desktop): add dismissible banner pointing to the new buzz app (#9379)
  fix(mobile): keep publishing presence while the app is open (#9441)
  feat(mobile): share into Buzz from the iOS share sheet (#9433)
  fix(mobile): qualify every namesake mention and keep authored mention casing (#9325)
  fix(mobile): match browser GIF timing in the iOS reaction sheet (#9437)
  fix(mobile): play short-delay animation frames at browser speed (#9432)
  buzz-search: read profile names without the profile_name_fields function (#9397)
  buzz-db: build the community deletion lock key in Rust (#9396)
  fix(cli): pair for the active community, skip stopped desktops, accept a bare relay host (#9417)
  test(mobile): run push tests without a gateway dart-define (#9423)
  fix(mobile): never pop Home when archiving from channel settings (#9387)
  perf(acp): reduce observer CPU and lock overhead (#9381)

Signed-off-by: Matthew Boston <[email protected]>

This branch was successfully deployed

1 active deployment
codex-review — b6de5527 Deployed Nov 12, 2026 by brow via Run Codex Security Review #14731
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.

3 participants