-
Notifications
You must be signed in to change notification settings - Fork 74
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
Use local read receipts for notifications #504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, although the notifications utilities should go in engine/notifications
rather than domain (domain is purely for stateless utility functions related to nostr data types).
f080ffb
to
3cbe593
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Various
SEEN_
events are still being fetched and decrypted, we can remove all of that. - The subscriptions on the notifications pages aren't doing anything any more.
- Record "mark all as seen" explicitly to avoid getting re-notified about old stuff. You'll need to check that when getting notifications for channels, which means you need to know which notification keys correspond to channels. So a different naming scheme than channel id might be needed.
onMount(() => { | ||
const tracked = new Set() | ||
setChecked(["replies", "mentions"]) | ||
|
||
const unsub = unreadMainNotifications.subscribe(async events => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all dead code now
src/app/views/ChannelsList.svelte
Outdated
@@ -39,6 +39,8 @@ | |||
} | |||
}) | |||
|
|||
const markAllChannelsRead = () => setChecked($channels.map(c => c.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do something here like channels/*
, since old events frequently come in after marking all as read, resetting the notification bell. This is a flaw of the current approach.
f5eb56e
to
f23715e
Compare
|
This can still be simplified a decent amount I think:
|
applied your suggestions, path based seen check Notifications are now under notes/* or reactions/, everything related to messages is under channels/, "*" is used for login and signup and is a fallback for any subpath no checked yet. |
- move notifications.ts to /engine/
- removed unused notification's subscriptions
213aed1
to
4564f0a
Compare
* local read receipts for notifications * local read receipts for channels * - fix read notification infinite loop - move notifications.ts to /engine/ * clean notifications import * - specific notifications prefix for channels - removed unused notification's subscriptions * path based seen check
* local read receipts for notifications * local read receipts for channels * - fix read notification infinite loop - move notifications.ts to /engine/ * clean notifications import * - specific notifications prefix for channels - removed unused notification's subscriptions * path based seen check
* local read receipts for notifications * local read receipts for channels * - fix read notification infinite loop - move notifications.ts to /engine/ * clean notifications import * - specific notifications prefix for channels - removed unused notification's subscriptions * path based seen check
#500
Use a local store for read receipts, inspired by flotilla.