This commit improves the robustness of mute list handling:
1. It listens to new mute lists from the relay interface, and saves them whenever there is a new one
2. It uses the user's own relay lists to fetch events (such as mute lists), helping to ensure we get their mute lists even when they are not stored in the Damus relay
3. It saves events it sees when fetching them from the network, if applicable
Changelog-Changed: Improved robustness of mute handling
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit adds a simple in-memory Nostr Event cache, to reduce the
amount of bandwidth used as well as to improve performance.
Testing
-------
Setup:
- Two iPhone simulators running Damus and on different accounts
- Damus version: 774da239b92ed630fbf91fce42d9e233661c0d7f
- Notepush: This commit
- Push notifications turned on, setup to connect to localhost, and configured to receive DM notifications
- Run Notepush with `RUST_LOG=DEBUG` env variable for debug logging
Steps:
1. Send a DM from one account to another.
- Push notification should arrive with a few seconds delay
- Push notification logs should mention that the event was cached
2. Send a DM again.
- Push notification should arrive immediately
3. Wait for more than a minute
4. Send a DM again.
- Push notification should take a few seconds again
- Push notification logs should mention that the cache item expired and was deleted
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Closes: https://github.com/damus-io/notepush/issues/3
Testing
-------
PASS
Devices: Mix of iPhone simulators and real devices
notepush: This commit
Damus: 4ea6c360e6e33747cb09ecf085049948ec1dadd1 (WIP change from GH issue #2360)
Setup:
- Account A with push notifications enabled, DM notifications enabled,
and "only notifications from following enabled"
- Account A follows B but not C
Steps:
1. Send DM to A from B. Push notification appears
2. Send DM to A from C. Push notification does not appear
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Closes: https://github.com/damus-io/damus/issues/2360