Skip to content
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

bug: passing a cursor that doesn't correspond to any message in the store will return all messages #2716

Closed
fbarbu15 opened this issue May 21, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@fbarbu15
Copy link
Contributor

Problem

A clear and concise description of what the bug is.

Impact

Indicate how significant you believe the impact of the bug is. Bugs that lead to data loss or corruption would be considered critical. In such cases, please also add the critical label.

To reproduce

  1. Have 4 messages in the store
  2. Send a store v3 request that returns all 4 message. Ex response:
    {"requestId":"","statusCode":200,"statusDesc":"OK","messages":[{"messageHash":{"data":"FU17V6jRMxU+Y+Kc+3JhEY9DeNeUiD00r6K288of5eA="}},{"messageHash":{"data":"JkVa/QrmhoEsVMvTroD0+0VIrL+bQ+PUDX8P0pH0mQk="}},{"messageHash":{"data":"7exieG0Juu60Avg8lPNqhlaSI6xJWhtNxacRGj8/rBc="}},{"messageHash":{"data":"CD0UNeVnNYVXjbhvVS/wRvVTA4Nvl7thShSh8siWPpM="}}]}
  3. Send another request with a cursor that doesn't correspond to any of the messages in the store. Ex:
    curl -v -X GET "http://127.0.0.1:54511/store/v3/messages?cursor=LOFSS2EfEYy1sAZktV0KVEdGPDG1gprMDVjUYM7QL2I%3D&pageSize=100&ascending=true&pubsubTopic=%2Fwaku%2F2%2Frs%2F0%2F0" -H "Content-Type: application/json"

Actual behavior

All messages in the store are returned

Expected behavior

Either empty messages list or an error saying that cursor doesn't match any message in the store

nwaku version/commit hash

harbor.status.im/wakuorg/nwaku:latest

Additional context

Logs
node.log

@fbarbu15 fbarbu15 added the bug Something isn't working label May 21, 2024
@SionoiS
Copy link
Contributor

SionoiS commented May 21, 2024

🤔 is it worth doing a search to check for cursor existence in the DB? This worst case seams fine to me but IDK.

We don't have to decide until the DB drivers are updated and optimized for v3. Either case, this should be an easy fix.

@chair28980
Copy link
Contributor

Likely related to #2653

@SionoiS
Copy link
Contributor

SionoiS commented May 23, 2024

fixed by #2718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants