Skip to content

fix: skip push registration in e2e - #1245

Draft
ovitrif wants to merge 8 commits into
masterfrom
fix/e2e-skip-push-registration
Draft

fix: skip push registration in e2e#1245
ovitrif wants to merge 8 commits into
masterfrom
fix/e2e-skip-push-registration

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Closes #1244

This PR skips push notification registration in E2E builds so those wallets stop registering short-lived FCM tokens with the Bitkit notification server.

Description

  • LightningRepo.registerForNotifications returns early with one info log when Env.isE2eTest is set. It is the single path for node start, FcmService.onNewToken, and the DevSettings action, so all three skip together. The FCM token fetch and keychain cache are simply not reached; receive-side handling is untouched.
  • The Dev Settings "Register For LSP Notifications" action toasts Skipped push registration in E2E builds.
  • E2E=true is already set on exactly the builds that matter: the three E2E APK steps in e2e.yml and e2e_migration.yml, plus just e2e. No new flag, no Gradle or workflow change. ci.yml and ui-tests never launch the app on a device, and release builds never set E2E.

Behavior on first launch, token rotation, wallet restore, and every non-E2E build is unchanged. Node-not-running handling is unchanged because the guard sits inside executeWhenNodeRunning.

Context: Blocktank staging thread; server-side pruning of dead tokens is synonymdev/bitkit-notification-server#19.

Follow-up: iOS counterpart synonymdev/bitkit-ios#739, same choke point.

Design

N/A — no UI changes.

Preview

N/A — no user-visible changes.

QA Notes

Manual Tests

  • 1. just e2e assembleDevDebug → install → create wallet → node start: log shows Skipped push registration in E2E build and no Registering device for notifications… line.
  • 2. regression: just build → create wallet → node start: registerForNotifications proceeds to the FCM token fetch as before.
  • 3. just e2e assembleDevDebug → Settings → Dev Settings → Register For LSP Notifications: toast Skipped push registration.
  • 4. (after merge) E2E workflow run → Blocktank staging WakeToTimeout reject lines: no new node ids appear.

Automated Checks

  • Verified on a regtest emulator with the earlier flag-based build of this branch: the skip path logged on node start; the default build entered the registration path. The guard is the same, only the condition changed to Env.isE2eTest.
  • No unit test: Env.isE2eTest is a compile-time constant, so the skip path is exercised by any E2E=true build, including every CI E2E run.
  • just build and just lint pass on the current head.
  • No changelog fragment: no user-facing change.

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The implementation appears safe to merge, with a non-blocking test-coverage gap around the disabled path's Firebase and keychain side-effect guarantees.

Findings

  1. P2 Disabled path incompletely tested

Summary

  • Adds PUSH_REGISTRATION_ENABLED to Gradle-generated build configuration and exposes it through Env.
  • Guards automatic, refreshed-token, and manual registration paths.
  • Configures local, staging, and migration E2E APK builds to disable registration.
  • Adds unit coverage for enabled and disabled registration behavior, though the disabled test does not yet cover all promised side-effect boundaries.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Node start, FCM token refresh, or manual action] --> B{Node running?}
    B -- No --> C[Return existing node-not-running failure]
    B -- Yes --> D{PUSH_REGISTRATION_ENABLED?}
    D -- No --> E[Log skip and return success]
    D -- Yes --> F[Use supplied token or fetch FCM token]
    F --> G[Compare cached keychain token]
    G --> H[Register device when needed]
    H --> I[Update notification keychain state]
Loading

Reviews (1) · Last reviewed commit: "fix: skip push registration in e2e build..."

@ovitrif ovitrif self-assigned this Sep 10, 2026
Comment thread app/src/test/java/to/bitkit/repositories/LightningRepoTest.kt Outdated
@ovitrif
ovitrif marked this pull request as draft September 10, 2026 13:13
@ovitrif ovitrif changed the title fix: skip push registration in e2e builds fix: skip push registration in e2e Sep 10, 2026
ben-kaufman
ben-kaufman previously approved these changes Sep 10, 2026
Comment thread app/src/main/java/to/bitkit/repositories/LightningRepo.kt
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.

fix: skip push registration in e2e

2 participants