-
Notifications
You must be signed in to change notification settings - Fork 295
Hide future notes from timeline #2967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you Terry |
I may need to do some more work to
|
if let item = item.filter({ ev in | ||
self.fine_filter.filter(contacts: contacts, pubkey: ev.pubkey) && | ||
// Allow notes that are created no more than 1 second in the future | ||
// to account for natural clock skew between sender and receiver. | ||
ev.age >= -1 | ||
}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Wait until Add notification setting to hide hellthreads #2946 is merged as it is more important and resolve merge conflicts afterward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
This is done. |
This PR is ready for review. Also please see the corresponding notepush PR. Do not merge until #2946 is merged as it is more important and due to merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you @tyiu!
Changelog-Fixed: Hide future notes from timeline Closes: damus-io#2949 Signed-off-by: Terry Yiu <[email protected]>
2f875ab
to
7ee970e
Compare
Thanks @tyiu! Resolved conflicts and merged! |
Summary
The
created_at
timestamp can be any value in the future as it can not be verified to be correct / the actual time the author posted. If someone does this, this note gets pinned at the top of the timeline in perpetuity until the system clock surpasses that timestamp and other notes get pulled in. This could be considered a malicious attack (or other users have a clock skew problem).This change defensively filters out future notes from the timeline until the system clock has actually surpassed the
created_at
timestamp.Closes: #2949
Related: damus-io/notepush#17
Checklist
Closes:
orFixes:
tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patchesTest report
Device: iPhone 16 Pro Simulator
iOS: 18.4
Damus: 2f875ab
Setup: Settings > General > Date & Time > Toggle off
Set Automatically
> Set current time to 2 or more minutes into the future (or whatever amount of time you need to run through the test steps)Steps:
master
branch.Results: