Skip to content

fix(notifications): sync background push toggle when OS permission denied#1156

Merged
7w1 merged 1 commit into
SableClient:devfrom
eleboucher:fix/background-push-toggle-permission-denial
Jul 20, 2026
Merged

fix(notifications): sync background push toggle when OS permission denied#1156
7w1 merged 1 commit into
SableClient:devfrom
eleboucher:fix/background-push-toggle-permission-denial

Conversation

@eleboucher

@eleboucher eleboucher commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

On mobile, backgroundPushEnabled defaults to true. Startup auto-registration threw on permission denial but only logged a warning, leaving the toggle ON even though push was non-functional. Now syncs backgroundPushEnabled to false and clears the provider when registration fails due to denied/dismissed permission. Transient errors are left alone.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

@eleboucher
eleboucher requested review from 7w1 and hazre as code owners July 20, 2026 12:18
…d push toggle

The native plugin returns Option<bool> (true=granted, false=denied,
null=never-asked) but the JS bindings typed it as Promise<boolean>,
flattening the tri-state. Fix the types to Promise<boolean | null>,
add a non-prompting isUnifiedPushPermissionGranted, and pre-check
permission at startup: if denied, sync backgroundPushEnabled to false
and skip registration; if never-asked or granted, proceed (prompting
if needed). On registration failure, re-check and sync if now denied.
@eleboucher
eleboucher force-pushed the fix/background-push-toggle-permission-denial branch from c5fa7ac to 753e87c Compare July 20, 2026 12:47
@7w1 7w1 added the internal label Jul 20, 2026
@7w1
7w1 added this pull request to the merge queue Jul 20, 2026
Merged via the queue into SableClient:dev with commit b52e59f Jul 20, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants