Skip to content

Respect explicit stay-connected-in-background opt-out despite FCM failures - #14914

Open
br4yd wants to merge 1 commit into
signalapp:mainfrom
br4yd:fix/background-connection-setting-ignored
Open

Respect explicit stay-connected-in-background opt-out despite FCM failures#14914
br4yd wants to merge 1 commit into
signalapp:mainfrom
br4yd:fix/background-connection-setting-ignored

Conversation

@br4yd

@br4yd br4yd commented Aug 4, 2026

Copy link
Copy Markdown

Contributor checklist

  • Samsung Galaxy S26 Ultra, Android 17
  • Google Pixel 10 Pro, Android 17
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

Fixes #14909

Currently, ForceWebsocketMode.DISABLED is used for two different scenarios:

  • The default state (when a user has never touched the "Stay connected in background" toggle).
  • The state when a user manually turns that setting off.

Because the app can't tell these two states apart, the automatic fallback logic breaks. Normally as far as I understand, if FCM (push notifications) fails for 3+ days, the app automatically enables WebSocket mode as a safety net. But because manual opt-outs look identical to the untouched default, the app keeps re-enabling WebSocket mode in the background even if the user explicitly turned it off. From the user's perspective, the setting just keeps resetting itself.

This showed up in the reporter's logs: FCM failed with FIS_AUTH_ERROR, so the app auto-enabled WebSocket mode. Every time the user turned it off, the next background sync saw DISABLED and immediately flipped it back on.

What this PR changes:

  • Adds a new DISABLED_BY_USER state that is only set when someone manually toggles the setting off.
  • Adjusts FcmRefreshJob so the automatic fallback only triggers on the untouched default state (DISABLED), ensuring manual user choices are actually respected.

Testing

  • Tested the new state logic and verified that the toggle updates correctly.

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.

Stay connected in background ignores setting

1 participant