Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show notifications for logged out accounts (part one for DMs) #4076

Closed
wants to merge 5 commits into from

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented May 17, 2024

Why

Notifications may be received for logged out accounts, even if we log out first. One option would be to add an endpoint to the backend such as unregisterPushToken, but this wouldn't be a 100% reliable method. For example, something could happen during the logout where the request for unregistering fails but the client still removes the account from the logged in sessions.

Instead, we can take advantage of the new notification handling logic to store logged out/disabled DIDs and prevent notifications for those accounts from showing up.

Right now, this will only work for DMs since we need to implement the recipientDid or similar in notifications as well. (We might be able to parse the subject for some types, will have to look).

For general performance reasons, I am also converting the all of the string array preference types to a map instead. These could get a little chunky for future use cases like thread mutes, so better to get ahead of that now.

Screen.Recording.2024-05-17.at.2.34.44.AM.mov

Copy link

render bot commented May 17, 2024

Copy link

github-actions bot commented May 17, 2024

The Pull Request introduced fingerprint changes against the base commit: 829f6a9

Fingerprint diff
[{"type":"dir","filePath":"modules/expo-background-notification-handler/android","reasons":["expoAutolinkingAndroid"],"hash":"3734e9c5079d4c6419b07b7e17adfc58d5c6e1fe"},{"type":"dir","filePath":"modules/expo-background-notification-handler/ios","reasons":["expoAutolinkingIos"],"hash":"5752801a1c20a2b8b349268a2637acf7c4c578c2"}]

Generated by PR labeler 🤖

Copy link

github-actions bot commented May 17, 2024

Old size New size Diff
6.82 MB 6.82 MB 589 B (0.01%)

@haileyok haileyok marked this pull request as ready for review May 17, 2024 08:57
@haileyok haileyok force-pushed the hailey/notifications-stuff branch from bfaad29 to ed8d9c0 Compare May 17, 2024 08:57
rm a log

hande async stuff better

swift != javascript

oops

remove from store whenever we sign back in

don't show notifications for dms on logged out accounts

filter out while foregrounded

smol

add disabled dids to android

migrate android to map

update more js

update types

update extension to support

no useless async

add js functions

revert oops
@haileyok haileyok force-pushed the hailey/notifications-stuff branch from c0917c8 to b5bb50c Compare May 17, 2024 09:36
@haileyok haileyok marked this pull request as draft May 17, 2024 15:15
@haileyok haileyok closed this Aug 8, 2024
@haileyok haileyok deleted the hailey/notifications-stuff branch September 2, 2024 20:07
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.

1 participant