Skip to content

Notifications: report fast mode unavailable on the website flavour - #2181

Merged
mpretty-cyro merged 2 commits into
session-foundation:devfrom
mpretty-cyro:fix/website-flavour-no-fast-mode
Aug 24, 2026
Merged

Notifications: report fast mode unavailable on the website flavour#2181
mpretty-cyro merged 2 commits into
session-foundation:devfrom
mpretty-cyro:fix/website-flavour-no-fast-mode

Conversation

@mpretty-cyro

Copy link
Copy Markdown
Collaborator

The bug

The de-googled build offers "Fast Mode (Recommended)" in onboarding and in Notification settings, lets
the user switch it on, and then never registers for push — with nothing saying so.

isFastModeAvailable() returned an unconditional true for this flavour, but the flavour has no FCM at
all:

  • firebase-messaging is added only to the play and fdroid variants (app/build.gradle.kts)
  • FirebasePushService is registered only in the play and fdroid manifests
  • website binds NoOpTokenFetcher, whose token is permanently null, and
    PushRegistrationHandler combines on token.filterNotNull() — so registration is never even
    attempted

Because the flavour is a build-time choice, the device's capability is irrelevant: a fully
Google-serviced phone that installs this APK still gets no push. Confirmed on an emulator with Play
Services present.

Why it is worse than "notifications are slower"

Choosing fast mode sets PUSH_ENABLED, and HomeViewModel gates the battery-optimisation prompt on the
user not being in fast mode. So the one mitigation that helps someone who is actually depending on
15-minute BackgroundPollWorker polling is suppressed for exactly the users who cannot receive push.

The change

Report fast mode unavailable on this flavour, with a comment recording why so it isn't "fixed" back to
true. The settings toggle then shows as disabled and the battery-optimisation prompt returns.

Known gap: existing installs are not migrated

A user who already enabled fast mode keeps PUSH_ENABLED set, so their prompt stays suppressed. The
clean follow-up is to treat "effectively in fast mode" as PUSH_ENABLED && isFastModeAvailable() at the
two read sites rather than mutating the stored preference — deliberately left out of this change.

Alternative considered

Giving website the same wiring fdroid already has (Firebase dependency plus the real
com.google.android.gms check) would let capable devices receive push. Not taken: this flavour exists to
be Google-free, and it began life as "add no op push manager for de-googled".

mpretty-cyro and others added 2 commits August 24, 2026 11:54
The de-googled build has no FCM at all — `firebase-messaging` is only added to the
`play` and `fdroid` variants and `FirebasePushService` only appears in their manifests,
so `website` binds `NoOpTokenFetcher` and its token is permanently null. But this
function returned an unconditional `true`, so onboarding and Notification settings both
offered "Fast Mode (Recommended)" and let it be switched on, after which no push was
ever registered and nothing said so. Confirmed on an emulator with Play Services
present: flavour is a build-time choice, so a fully Google-serviced device gains nothing.

Worse, choosing it set PUSH_ENABLED, which suppresses HomeViewModel's
battery-optimisation prompt — removing the one mitigation that helps a user who is
actually depending on 15-minute background polling.

Note this does not migrate existing installs: a website user who already enabled fast
mode keeps PUSH_ENABLED set, so their prompt stays suppressed until that pref is also
taken into account.
@mpretty-cyro
mpretty-cyro merged commit 6073cab into session-foundation:dev Aug 24, 2026
5 checks passed
@mpretty-cyro
mpretty-cyro deleted the fix/website-flavour-no-fast-mode branch August 24, 2026 04:02
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.

2 participants