-
Notifications
You must be signed in to change notification settings - Fork 248
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
fix_: ensure individual store queries do not exceed 24h while still allowing to retrieve more than one day of messages #6115
Conversation
Jenkins BuildsClick to see older builds (32)
|
protocol/messenger_mailserver.go
Outdated
@@ -880,6 +855,8 @@ loop: | |||
contentTopics: w.contentTopics, | |||
cursor: cursor, | |||
limit: nextPageLimit, | |||
from: w.from, | |||
to: nextWorkTo, |
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.
What happens if above line cursor == nil
?
It seems we need to first processNextPage with the cursor then process the nextWorkTo
? Now it combines the cursor (processNextPage) and nextWorkTo
.
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.
ah good point!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6115 +/- ##
===========================================
+ Coverage 60.95% 60.97% +0.01%
===========================================
Files 827 827
Lines 109734 109708 -26
===========================================
+ Hits 66890 66895 +5
+ Misses 34989 34964 -25
+ Partials 7855 7849 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
BTW, we found today with @Ivansete-status that some of the store requests fetched a whole month. I assume it was an account recovery, but not sure.
So I guess this PR would fix it.
One additional improvement in that case would be to make the account recovery smarter. If you fetched all the needed info in the last 24 hours, you don't need the info from a week past, since you only need the most recent.
Maybe something to fix in another issue. Though I'm not sure if it should be fixed by the Status or Waku team 🤔
To fix that, we can do something similar to what @igor-sirotin implemented here:
processMailserverBatchWithOptions to indicate whether to continue fetching messages from storenode or not.
|
This PR also fix #6046 |
38dce59
to
2244bfc
Compare
757c9bb
to
50f2c74
Compare
50f2c74
to
6d2a89a
Compare
Fixes #6057
Also, due to how we use seconds in some parts of the code, there's a loss of precision in the end date of the store queries which translates in potentially missed messages. To quickly fix this I just add a second and subtract a nanosecond to ensure that the end date will include the whole second.
This however should be properly fixed by using time.Time across all codebase instead as mentioned in #5857 (comment)
cc: @fryorcraken