Skip to content

fix: skip push registration in e2e - #1245

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

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 used in the three E2E APK steps in e2e.yml and e2e_migration.yml, also in plus just e2e.

Limited scope change, nothing relevant of the happy flow is affected because the build flag is not exercised for those builds.

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

Follow-up: iOS counterpart synonymdev/bitkit-ios#739.

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.
  • 2. just e2e assembleDevDebug → Settings → Dev Settings → Register For LSP Notifications: toast Skipped push registration.

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: 5/5

The PR appears safe to merge, with E2E registration skipped at the shared choke point and no outstanding findings.

Summary

  • Returns successfully before Firebase token retrieval, keychain access, and server registration when Env.isE2eTest is enabled.
  • Reports the skipped registration through the Dev Settings toast.
  • Leaves receive-side notification handling and non-E2E registration unchanged.

Reviews (2) · Last reviewed commit: "fix: toast skipped push registration in ..."

@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
@ovitrif
ovitrif marked this pull request as ready for review September 11, 2026 22:44
@ovitrif

ovitrif commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

The reason for this PR is to reduce the load of push notifications tokens registrations (issue flagged by @dzdidi in thread about staging backend overload by bitkit ci).

The issue is also related to missing cleanup in the our notification server, an issue flagged separately in that repo -- cleanup can be done on trigger of deterministic signal returned by the specific platform's notifications delivery server when trying to access it, the returned payload includes a certain error code which our backend can use to ack those devices are never gonna be available anymore in there, so they can be purged.

E2E tests never use those anyways but @piotr-iohk can db check to confirm.

@github-actions

Copy link
Copy Markdown
Contributor

Regtest APK

Built from ab24334 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@ovitrif
ovitrif requested a review from ben-kaufman September 11, 2026 22:56
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