Page MenuHomePhabricator

[lib] Convert generatesNotifs to function
ClosedPublic

Authored by ashoat on Jan 10 2023, 3:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 4:53 PM
Unknown Object (File)
Thu, Nov 28, 4:24 AM
Unknown Object (File)
Thu, Nov 28, 4:24 AM
Unknown Object (File)
Thu, Nov 28, 4:24 AM
Unknown Object (File)
Thu, Nov 28, 4:24 AM
Unknown Object (File)
Nov 9 2024, 2:31 AM
Unknown Object (File)
Nov 9 2024, 2:30 AM
Unknown Object (File)
Nov 9 2024, 2:28 AM
Subscribers

Details

Summary

Includes handling the userNotMemberOfSubthreads logic that was previously handled in message-creator.js.

Depends on D6222

Test Plan

Flow, plus tested chat creation, message creation, liking and unliking a user's message, and liking and unliking somebody else's message

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

accepting with one clarifying question

lib/shared/messages/message-spec.js
111–112

Didn't pick this up when we were working together, but is it okay that these arguments are not optional?

This revision is now accepted and ready to land.Jan 10 2023, 4:07 PM
lib/shared/messages/message-spec.js
111–112

Yeah – it's only called from one place, and that place always specifies both params

This revision was automatically updated to reflect the committed changes.
keyserver/src/creators/message-creator.js
382–383 ↗(On Diff #20774)

At this point it's correct, but might change in the future. For example I can imagine that reminders could be implemented as a new type of message that can send a notification when is created. Obviously, the fact that creator's activity doesn't generate notifs might remain true forever and designing a solution that doesn't assume that might be a waste of time.

I have a slight preference to a solution where each message spec can decide if user's own activity generates notifs, but keeping this as is is also perfectly valid. A big downside of my solution is that it will create a lot of duplication and can cause some bugs when a developer forgets to add this check to a new spec.

keyserver/src/creators/message-creator.js
382–383 ↗(On Diff #20774)

Yeah, we opted for this to avoid duplication and to keep the message specs simple in most cases, but it would be really easy to change that later if we ever wanted to introduce something like the "reminders" feature you described