-
Notifications
You must be signed in to change notification settings - Fork 596
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
Notifications #200
Notifications #200
Conversation
@@ -36,6 +36,7 @@ export default function (server: Server) { | |||
) | |||
.leftJoin(User, 'author', 'author.did = post.creator') | |||
.where('user.did = :did', { did: requester }) | |||
.andWhere('post.creator != :requester', { requester }) |
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.
we weren't returning a user's posts in their feed, but we were returning them if they were reposted, so this strips those out as well. can change this if we like
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.
Actually I think we need user's posts in their feed, but not the retweets? It can be confusing not to see your own posts
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.
Made an issue. i'll get to it soonish: #201
|
||
export default function (server: Server) { | ||
server.todo.social.postNotificationsSeen(async (_params, input, req, res) => { | ||
const { seenAt } = input.body |
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 allows any time to be set as seenAt
i thought maybe doing the Max
of seenAt
& the currently registered time in the DB, but then thought there might be a usecase for "rewinding" notifications 🤔
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.
Yeah probably no concern about auditing it
await Promise.all([ | ||
table.delete(uri), | ||
recordTable.delete(uri.toString()), | ||
this.notifications.deleteForRecord(uri), |
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.
removes notifications for deleted objects
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.
Looking good. Can merge as is, but I wonder if the reason
token ought to be an NSID-based constant? Like app.bsky.likeEvent
. Would need a new Lexicon doc type probably.
* notification methods on tables * process notifs * last seen * notifs xrpc methods * seen notifs route * register route * notifications tests * rm unused db method
Notifications 🔔
Adds a notifications table that maintains a list of all notifications relevant to a user.
Adds views for
Handles notification
reason
s similarly to entitytype
s: it's an unconstrained field, but there is a comment in the schema suggesting what expected values are.For each notification, returns: