-
Notifications
You must be signed in to change notification settings - Fork 401
Add method to get unread inbox notifications count for rooms #2074
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
Conversation
| * @example | ||
| * const count = await room.getUnreadInboxNotificationsCount(); | ||
| */ | ||
| getUnreadInboxNotificationsCount(): Promise<number>; |
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.
I suppose this is a method we know we wish to support also in the long term, so it is fine to not mark it as experimental.
| await authManager.getAuthValue({ | ||
| requestedScope: "comments:read", | ||
| roomId: options.roomId, | ||
| }) |
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.
@ofoucherot @marcbouchenoire I am not very well versed in the current auth manager but we seem to request cached token for this very scope comments:read for a lot of other methods (createThread, deleteThread) currently. Should we be requesting room:read scope in this particular method?
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.
Yes, for inbox-notifications it should be room:read.
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.
I agree that room:read is the right one.
That said, if you use comments without storage, you'd still want to have the notifications. In which case you need the less powerful permission (comments:read) to still provide notifications.
Wondering if this is a missing piece in our system. And we should add a notifications:write/read permission.
|
Closing, more thought needs to be put into this, with an API that likely reuses the project level one using queries |
|
For full context to posterity, I suggested a potential different solution direction for this here privately on Slack. |
Descriptions
Adds
room.getUnreadInboxNotificationsCountUsage: