Notification endpoints does not process bitfields #761
Labels
Priority: High
Should be done first and foremost, absolutely essential for this release.
Size: Medium
Something that may take a few days or so to implement.
Type: Bug
Something isn't working the way it should
Old backend's method of doing updates to
notifyOn
values onMapNotify
and is to batch all the flags into a bitfield where eachActivityType
valuex
corresponds to the a1 << x
bit shift. It then stores that bitfield in DB, andgenNotifications
handles breaking down the field into flags.This method seems fine to me, though we'll need to use a raw query for the DB stuff, since Prisma still doesn't support bitwise operations and given their bizarre prioritization decisions, probably won't for a long time. Maybe possible with Prisma Client Extensions? Don't really mind doing the raw query either way.
Actually supporting this is pretty much just a matter of changing the validators on relevant endpoints to allow values that aren't individual
ActivityType
s, and do #760 so notifications actually get generated.Ideally write a bunch more tests for notification-related behaviour. The old API had a couple of really complex E2E tests, we could do similar, e.g. submitting a map, it getting approved, someone following it, then someone submitting a run on it, checking it generates notifications. Could do as backend E2E, though if we wanna get really fancy, we could do in frontend E2E - honestly this sounds like the way to go.
The text was updated successfully, but these errors were encountered: