Skip to content

fix(notifications): route push transports by explicit provider#1273

Merged
7w1 merged 5 commits into
SableClient:devfrom
eleboucher:fix/push-transport-switch
Jul 24, 2026
Merged

fix(notifications): route push transports by explicit provider#1273
7w1 merged 5 commits into
SableClient:devfrom
eleboucher:fix/push-transport-switch

Conversation

@eleboucher

@eleboucher eleboucher commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes several Android push-notification bugs, and bumps tauri-plugin-notifications to pick up the matching native fixes (SableClient/tauri-plugin-notifications#11).

Transport routing

  • Pass provider: 'fcm' / provider: 'unifiedpush' explicitly on register, so the plugin routes deterministically instead of inferring from saved state (switching to native no longer keeps using the old UnifiedPush distributor).
  • switchBackgroundPushTransport is break-before-make (deactivate old → register new), which the plugin's single-active-provider guard requires. If the new registration fails, the previous transport is now restored instead of leaving the device with no pusher while the UI still says push is on.
  • Skip no-op mode changes when the resolved provider is unchanged.
  • enablePushNotifications no-ops under Tauri instead of throwing (fixes the SABLE-162 unhandled rejection).

Background notification previews

  • Encrypted message bodies could appear in notifications with "show encrypted content" disabled: isEncryptedRoom is derived from the local room, which is absent on a cold start from push, so the gate passed and the decrypted body was shown. Encryption is now taken from the fetched event itself.
  • A notification dismissed while its preview fetch was in flight could reappear ("ghost" notification), the async update now checks the cache is still the live one.
  • An earlier message no longer stays stuck on the "New message" placeholder when a second push arrives before its preview resolves.
  • The second (enriching) post is awaited so failures are logged instead of becoming unhandled rejections, and the per-room seen-event set is capped.

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 24, 2026 08:20
@eleboucher
eleboucher force-pushed the fix/push-transport-switch branch 5 times, most recently from 1a1ca63 to d60c6dd Compare July 24, 2026 10:44
@eleboucher
eleboucher force-pushed the fix/push-transport-switch branch from d60c6dd to 014c4eb Compare July 24, 2026 10:47
@eleboucher
eleboucher marked this pull request as draft July 24, 2026 15:34
@eleboucher
eleboucher marked this pull request as ready for review July 24, 2026 21:08
@7w1
7w1 added this pull request to the merge queue Jul 24, 2026
Merged via the queue into SableClient:dev with commit 4cbc077 Jul 24, 2026
14 checks passed
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