-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fix Confluence cursor handling for pagination #15814
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
The previous implementation used the full URL link as a cursor value instead of extracting just the cursor parameter. This caused an "INVALID_REQUEST_PARAMETER" error when users tried to use "Load More" when searching for Space IDs. - Added a new method _extractCursorFromLink() to extract only the cursor parameter from the URL - Fixed cursor handling in the paginate method and propDefinitions - Updated package and component versions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis pull request includes version updates across multiple modules, bumping the version from "0.0.1" to "0.0.2" in several files. In addition, a new method Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant ConfluenceApp
participant URL
Caller->>ConfluenceApp: Invoke options/paginate with link
ConfluenceApp->>ConfluenceApp: Call _extractCursorFromLink(link)
ConfluenceApp->>URL: Create URL(link)
URL-->>ConfluenceApp: Return URL object (or error)
ConfluenceApp->>ConfluenceApp: Extract cursor from search parameters
ConfluenceApp-->>Caller: Return extracted cursor (or null)
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
components/confluence/actions/create-post/create-post.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/confluence/actions/update-post/update-post.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/confluence/confluence.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/confluence/confluence.app.mjs (1)
109-118: Well-implemented utility method for cursor extraction.The new
_extractCursorFromLinkmethod properly handles cursor extraction from links, with robust null checking and error handling. This encapsulates the pagination cursor logic in one central place, making the code more maintainable.Consider adding JSDoc comments to document the expected input format and return value:
+/** + * Extracts the cursor parameter from a pagination link + * @param {string|null} link - The pagination URL containing cursor parameter + * @returns {string|null} - The extracted cursor value or null if not found + */ _extractCursorFromLink(link) { if (!link) return null; try { const url = new URL(link); return url.searchParams.get("cursor"); } catch (e) { console.log("Error extracting cursor from link:", e); return null; } },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
components/confluence/actions/create-post/create-post.mjs(1 hunks)components/confluence/actions/delete-post/delete-post.mjs(1 hunks)components/confluence/actions/update-post/update-post.mjs(1 hunks)components/confluence/confluence.app.mjs(4 hunks)components/confluence/package.json(1 hunks)components/confluence/sources/new-page-or-blog-post/new-page-or-blog-post.mjs(1 hunks)components/confluence/sources/watch-blog-posts/watch-blog-posts.mjs(1 hunks)components/confluence/sources/watch-pages/watch-pages.mjs(1 hunks)
✅ Files skipped from review due to trivial changes (7)
- components/confluence/actions/update-post/update-post.mjs
- components/confluence/sources/watch-pages/watch-pages.mjs
- components/confluence/actions/delete-post/delete-post.mjs
- components/confluence/package.json
- components/confluence/sources/new-page-or-blog-post/new-page-or-blog-post.mjs
- components/confluence/actions/create-post/create-post.mjs
- components/confluence/sources/watch-blog-posts/watch-blog-posts.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (3)
components/confluence/confluence.app.mjs (3)
33-33: Improved cursor extraction from options.Good update to use the new extraction method instead of directly using the raw link.
64-64: Consistent cursor extraction implementation.Similar to the postId implementation, this correctly uses the new extraction method.
216-218:✅ Verification successful
Enhanced pagination cursor handling.
The pagination method now properly extracts the cursor value from the link, fixing the issue described in the PR objectives. This should resolve the "INVALID_REQUEST_PARAMETER" errors when using the "Load More" button with Space ID selections.
🏁 Script executed:
#!/bin/bash # Verify if the pagination logic is consistently implemented across other pagination methods # in the codebase # Look for any other pagination implementations that might need similar fixes rg -A 5 "links\?.next" --type js --type mjsLength of output: 73
Enhanced Pagination Cursor Handling Verification
The changes in
components/confluence/confluence.app.mjs(lines 216-218) now correctly extract the pagination cursor using_extractCursorFromLink(), which should fix the "INVALID_REQUEST_PARAMETER" errors when using the "Load More" button with Space ID selections. However, our initial automated search encountered issues due to file type recognition; please manually verify that similar pagination logic isn’t required elsewhere in the codebase.
🏁 Script executed:
#!/bin/bash # Define mjs file type and search for pagination logic usage across the repository. # This re-run will help verify if the pagination cursor extraction using "links?.next" is unique to the confluence module. rg --type-add=mjs:'*.mjs' -A 5 "links\?.next" --type js --type mjsLength of output: 7638
Enhanced Pagination Cursor Extraction in Confluence
The changes in
components/confluence/confluence.app.mjs(lines 216–218) are now correctly using the_extractCursorFromLinkmethod to obtain the cursor fromlinks?.next. This adjustment clears the "INVALID_REQUEST_PARAMETER" errors when using the "Load More" button with Space ID selections.
- The updated code assigns the extracted cursor to
args.params.cursoronly when a valid cursor exists.- A repository-wide search shows that while several modules implement pagination (e.g., Big Cartel, Constant Contact, DNSfilter), the Confluence module uniquely benefits from this dedicated cursor extraction method.
- Please manually verify that the distinct implementations across modules are intentional and that similar improvements are not required elsewhere.
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.
Hi @dannyroosevelt, LGTM! Ready for QA!
Summary
_extractCursorFromLink()helper method to parse the cursor valueTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit