-
Notifications
You must be signed in to change notification settings - Fork 56
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: store v3 validate cursor & remove messages #2636
Conversation
You can find the image built from this PR at
Built from 6f4da99 |
You can find the image built from this PR at
Built from 6f4da99 |
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.
For a message that exists in the DB, the response is incorrect. It should have included a WakuMessageKeyValue with just the message hash.
REQUEST
{"request_id":"d4b573abb709d067da8afca3ec7341a8fbebee09923b4ade414e6b510bb6e24f","include_data": false, "message_hashes":["PmqobzCu78df5nprhzOUUu0e6pCFcOACjQpJistzVKM="],"pagination_forward":true,"pagination_limit":20}
RESPONSE
{"request_id":"d4b573abb709d067da8afca3ec7341a8fbebee09923b4ade414e6b510bb6e24f","status_code":200,"status_desc":"OK"}
If I change the include_data
attribute to true
, the response returns as expected (hash + message)
What should happen if I send a request with a valid cursor that does not exist? i.e.
Currently it is returning all the records but it seems to me that this behavior is not valid, and perhaps it should return either no results, or an invalid_cursor error. I think we should do the later, and probably do a |
This PR may contain changes to database schema of one of the drivers. If you are introducing any changes to the schema, make sure the upgrade from the latest release to this change passes without any errors/issues. Please make sure the label |
Seams like the old code never validated the cursor, it's only used to order the results. I agree that we should do it though. |
I see! It can be done later in a separate PR then. Will open an issue so we don't lose track of this :) -- |
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! Thanks!
Just added some comments that I hope you find useful
@@ -377,7 +377,7 @@ proc getMessagesV2ArbitraryQuery( | |||
endTime = none(Timestamp), | |||
maxPageSize = DefaultPageSize, | |||
ascendingOrder = true, | |||
): Future[ArchiveDriverResult[seq[ArchiveRow]]] {.async.} = | |||
): Future[ArchiveDriverResult[seq[ArchiveRow]]] {.async, deprecated.} = |
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.
I'm not saying that is incorrect to label those procs as deprecated
but how we should handle those? Do they still work/compile?
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.
I assumed it would only be a visual thing but I can't find any documentation so 🤷 They do compile/work though.
Fixes #2635 and #2634