-
Notifications
You must be signed in to change notification settings - Fork 49
Ensure we have ledgers to index into #599
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
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.
Pull request overview
Fixes a panic in the getLedgers RPC method when the queried ledger slice is empty (e.g., due to a race between cached latest ledger and the read transaction snapshot), aiming to return an empty page with a usable cursor instead of failing the request.
Changes:
- Adds a length check before indexing into the
ledgersslice when deriving the response cursor. - Introduces a fallback cursor value when no ledgers are returned.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot review it again pls |
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #598.
Why not error? Well there's no reason to, really. Returning an empty page with a valid cursor that would effectively perform the same request is a better UX.