-
-
Notifications
You must be signed in to change notification settings - Fork 90
Fix traverseCollection() for inline CollectionPage without id #550
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 traverseCollection() for inline CollectionPage without id #550
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @moreal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical bug in the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request provides a solid fix for an issue in traverseCollection() where inline CollectionPage objects without an id were not being handled correctly. The change to use the result of collection.getFirst() directly, instead of relying on collection.firstId, is the correct approach to solve this problem. I appreciate the inclusion of a regression test, which ensures the fix is effective and prevents future regressions. The accompanying refactoring to reduce code duplication is also a welcome improvement. The changes are well-implemented and the changelog is clearly updated. Overall, this is an excellent contribution.
dahlia
left a comment
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.
Good catch! Thanks!
|
Released with 1.9.5 and 1.10.3. |
Summary
traverseCollection()usedcollection.firstIdto determine whether a collection is paginated. When a server (e.g. Mastodon) embeds a CollectionPage inline in the first property without an explicit id,firstIdreturns null, causing the function to enter the non-paginated branch and callcollection.getItems()— which yields nothing because items live on the page, not the collection itself.Replace the
firstIdcheck with an actualgetFirst()call so that inlineCollectionPageobjects are correctly detected and traversed.Related issue
I couldn't find related issue when searching with following queries:
label:type/bugtraversecollectionChanges
List the specific modifications made in this PR.
Focus on what was changed without going into detail about impact.
traverseCollectioncallCollection.getFirst()instead to check onlyCollection.firstId.Benefits
traverseCollectioncan handle collections with afirstproperty withoutidproperty. (e.g., MastodonNote.replies)Checklist
mise teston your machine?1.9-maintenancebranch, there is notestmise task. So I rundeno task test,pnpm run test,pnpm run test:bunAdditional notes
Mastodon
Note.repliesexample: