Repository navigation
test(mobile): run push tests without a gateway dart-define - #9423
Conversation
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>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
kazemek21
left a comment
There was a problem hiding this comment.
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
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]>
…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]>
A plain
cd mobile && flutter testfailed 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_URLdefine (Env.pushGatewayConfigured, since #7261 configurable gateway made the gateway optional). Without it the app is a push-less build:readBuzzPushEndpointGrants()returns no grants andbuzzPushLifecycleEnabled()is false. CI's mobile shards,just mobile-testand the lefthook pre-push lane (which runsjust mobile-test) all pass--dart-define=BUZZ_PUSH_GATEWAY_URL=https://push.example; a bareflutter testpasses nothing. Each of the 11 was checked against that:notification_toggle_test(5 cases) andpush_lease_revocation_outbox_test"hosted relay assertion": no endpoint grants without a gateway (Bad state: No elementat 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 ahttps://push.buzz.xyzdefault that #7261 configurable gateway removed from the app; under CI's define both sides equalpush.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 takePendingNotificationResponselog 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.pushGatewayUrlbecomes a getter over the compiled value with a@visibleForTestingdebugPushGatewayUrlOverride(the same pattern asdebugUriStreamOverride), andtest/flutter_test_config.dartsets it for every test file.push_unconfigured_build_testsets it to'', so it runs in the main suite instead of being skipped there and run separately. CI, the Justfile,scripts/flake-check.mjsand the AGENTS/README check commands drop the define, so CI,just mobile-test, pre-push and a bareflutter testrun the same thing.I chose this over documenting a canonical command because the define can't be made automatic:
flutter testhas 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.pushGatewayUrlmust equal the compiledBUZZ_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 answerstakePendingNotificationResponsewith 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-snapshotprobe 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
flutter testfailed exactly these 11; the same files passed on the same machine with the define.just mobile-checkandjust mobile-test(now a bareflutter testplus the recipe and secp256k1 checks) pass, with the push-less tests running instead of skipped.scripts/flake-check.test.mjspasses.defaultValueto the compiled gateway fails the new no-default test, and removingflutter_test_config.dartbrings back the other 10 failures.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.