Fix notifications arriving on foreground after accepting invite (#361)

* fix: notifications arriving on foreground

* docs: update changelog
This commit is contained in:
Pepi
2026-02-21 08:34:51 +01:00
committed by GitHub
parent aa31039d60
commit cc8ab754d6
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -95,5 +95,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Sanitize malformed UTF-16 in user metadata to prevent rendering crashes [PR #234](https://github.com/marmot-protocol/whitenoise/pull/234)
- Lock app orientation to portrait mode [PR #235](https://github.com/marmot-protocol/whitenoise/pull/235)
- Fix camera permission flow [PR #194](https://github.com/marmot-protocol/sloth/pull/194)
- Fix notifications arriving on foreground after accepting invite [PR #361](https://github.com/marmot-protocol/whitenoise/pull/361)
### Security
+1 -1
View File
@@ -14,7 +14,7 @@ void useActiveChat({
setActiveChat(groupId);
cancelGroupNotifications(groupId);
});
return () => Future.microtask(clearActiveChat);
return null;
}, [groupId]);
useOnAppLifecycleStateChange((previous, current) {
+4 -2
View File
@@ -151,7 +151,9 @@ void main() {
expect(cancelNotificationsCalls, ['group123']);
});
testWidgets('clears active chat on unmount', (tester) async {
testWidgets('does not clear active chat on unmount to prevent navigation race condition', (
tester,
) async {
await mountHook(tester, () {
useActiveChat(
groupId: 'group123',
@@ -169,7 +171,7 @@ void main() {
await tester.pump();
expect(setActiveChatCalls, isEmpty);
expect(clearActiveChatCallCount, 1);
expect(clearActiveChatCallCount, 0);
});
});
}