Skip to content

[bug] One refused push registration turns push off for that server until app storage is cleared (Android phone, tablet) #785

Closed

Description

@zZebrahz

Problem

After a single refused push registration, the Android app never tries to register that server for push again. Nothing in the app says push is off; signing out and back in, and turning notifications off and on, don't recover it. Only clearing the app's storage does.

Seen once on an Android phone, Silo Android 1.0.0 (28) · 3cecc7a66, against a server at build 1804 · cc851494, during Notifications validation on 2026-11-02. The maintainer had removed the server in the app without signing out (#784) and added it back. The re-registration got 403 permission_denied ("The installation credential is invalid."): the server still held the phone's earlier installation key for the same device ID, and the app had made a new key. From then on the app called getPushRegistrationCapabilities and stopped; it never called registerPushDevice again, even after the server's stale installation record was deleted and the maintainer signed out, signed in and toggled notifications. Clearing the app's storage fixed it. A second remove-and-re-add did not reproduce the 403, so the exact trigger for the refusal is not pinned down.

Source evidence

origin/main at 51d4f9013, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/push/AndroidPushRegistrar.kt:

  • Line 559-561: a 401, 403, 409 or 422 answer to a registration stores refusal = "push_registration_refused" on the installation record ("No generation rebase or replacement secret after a definite refusal").
  • Line 520: every later registration for that record returns failure(it.refusal) before sending anything.
  • Nothing sets refusal back to null. The record lives in noBackupFilesDir/push-installations-v2 (PushInstallationStore.kt:61), keyed by server URL and device ID, so it survives sign-out, notification toggles and app updates.

Expected behavior

A refused registration does not disable push for that server forever. A new sign-in, or turning notifications back on, starts a fresh registration (new installation key or a new generation), and if push stays unavailable the notification settings say so instead of showing it as on.

Validation

  1. Make the server refuse one registration from a phone (for example: the server holds an installation record for the phone's device ID with a different key).
  2. Sign out and back in, or turn notifications off and on.
  3. The app should register again (registerPushDevice reaches the server) and push should work, without clearing app storage.

Non-blocking; found during Notifications validation (Android task #346 C2).

AI-assisted: drafted with Claude Code (claude-opus-5-5) and GitHub CLI at the maintainer's direction. Behavior observed by the maintainer on a phone; registration calls and server state read by the agent from the server's logs and database; source traced on origin/main.

Activity

  1. added theissue type on Nov 2, 2026
  2. added
    bug
    impact: usability
    priority: P2
    on Nov 2, 2026
  3. Quick104 commented on Nov 5, 2026

    @Quick104
    Contributor

    Fixed on main by #795, first shipped in v1.0.0-beta.29. The build in this report (1.0.0 (28)) predates it.

    #795 changed the stored-refusal check in AndroidPushRegistrar so a refusal blocks only the login that received it. Every sign-in writes a new login ID, and a re-added server keeps its server ID (it is derived from the URL). Signing out and back in, or removing the server, adding it back and signing in, now registers again at the next generation with the same installation key. The key stays the same because Android has no installation reset route and the push contract forbids sending a replacement key.

    Checked with a unit test on main (e57fbf3f6): after a 403, the same login stays refused and sends nothing; a new sign-in sends generation 2 with the same key and is acknowledged. Not re-tested on a device.

    Not covered, and not part of #795:

    • Turning notifications off and on changes a server preference only. It never triggered push registration, so it is not a recovery path.
    • Notification settings still don't say when push registration was refused. That can be tracked separately if wanted.

    AI-assisted: investigated with Claude Code (claude-opus-5-5) and GitHub CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugimpact: usabilitypriority: P2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions