planetary-social / nos-notification-service-go

A service which delivers push notifications to APNs
Mozilla Public License 2.0
3 stars 0 forks source link

Change payload to allow future lists #64

Closed dcadenas closed 2 weeks ago

dcadenas commented 3 weeks ago

This change makes the payload ready for integration with the app according to the comment in https://github.com/planetary-social/nos/issues/1447#issuecomment-2322128687

The payload coming from the pubsub will be changed in future work in the followers server

dcadenas commented 3 weeks ago

It's only for the follow notifications

dcadenas commented 2 weeks ago

@mplorentz I added the rest of the changes to accomodate to a new type of payload that can handle batches of follows and unfollows in a single notification so we now can add some code in the followers server to have notifications like You have 29 new followers and 29 unfollows!. The payload will include the npubs of each of these, no friendly strings as we don't even show them in these cases and I also added some tests to find which is the maximum we can stuff (58 npubs in total) before hitting the payload limit of 4096.

This is behind a feature flag and is well tests so I'll go ahead and merge so I don't get blocked during this holiday, but of course feel free to review. I also wanted you see how the payload is constructed because you or someone else from the iOS team will consume the payloads

mplorentz commented 2 weeks ago

Sounds good! Just want to make sure you are syncing with Linda on these behavior changes if you haven't already.