Skip to content

Fix/notification hardening#11

Merged
eleboucher merged 6 commits into
SableClient:mainfrom
eleboucher:fix/notification-hardening
Jul 24, 2026
Merged

Fix/notification hardening#11
eleboucher merged 6 commits into
SableClient:mainfrom
eleboucher:fix/notification-hardening

Conversation

@eleboucher

Copy link
Copy Markdown
Collaborator

No description provided.

@eleboucher
eleboucher force-pushed the fix/notification-hardening branch from 9b7aaaf to 92a2442 Compare July 24, 2026 20:33
@eleboucher
eleboucher merged commit 87e452f into SableClient:main Jul 24, 2026
21 checks passed
charm-cloudhub-social Bot pushed a commit to CloudHub-Social/Charm-1.0 that referenced this pull request Jul 24, 2026
…Client#1273)

<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### 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

- [x] 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:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] 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).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
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