Closed SatsAllDay closed 1 month ago
api/resolvers/item.js (1)
`1234-1234`: LGTM! The change enhances the context passed to `notifyMention`, aligning with the PR's objectives. Consider the performance impact of DB calls for each mentioned user as noted in previous discussions.
Description
Closes #717
This PR updates the push notification code paths to ensure that user-configured mutes are checked before sending push notifications, if applicable. The following code paths were updated:
This PR also updates the API validation to disallow users from muting and subscribing to the same user - only one or the other is allowed. No migration is performed, so if any user got themselves into this state, they can keep it until they change it. Then they can't go back.
In order to explain this behavior to users, I updated the UI code that toggles subscriptions/mutes to show the error message from the API request in the error toast, instead of a generic "Failed to <mute|subscribe>" message.
Screenshots
N/A
Additional Context
N/A
Checklist
Are your changes backwards compatible? Please answer below: Yes. No database changes or migrations. The only notable change is that users will no longer be able to mute and subscribe to the same user. However, if they've already done that, it will still be honored. They just can't re-configure such a thing.
Did you QA this? Could we deploy this straight to production? Please answer below: Yes.
For frontend changes: Tested on mobile? Please answer below: N/A
Did you introduce any new environment variables? If so, call them out explicitly here: No.