Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Nov 17, 2025

Adds prop maxId, minId, and sinceId to help support pagination of large data sets.

Followup to #19014

Summary by CodeRabbit

  • New Features
    • Added pagination support for account following lists with optional pagination identifiers (Max ID, Min ID, Since ID).
    • Enhanced pagination handling to expose link information for navigating through result sets.

@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 17, 2025 7:38pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 17, 2025 7:38pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Walkthrough

The get-accounts-following action is enhanced to support pagination. Version updated to 0.0.3 with new optional props (maxId, minId, sinceId) for tracking pagination state. The return value restructured from an array to an object containing accounts and paginationLinks. The package version bumped to 0.2.2.

Changes

Cohort / File(s) Summary
Pagination Enhancement
components/mastodon/actions/get-accounts-following/get-accounts-following.mjs
Version bumped to 0.0.3. Added optional pagination properties (maxId, minId, sinceId). Updated run() to pass pagination query parameters. Enhanced Link header parsing to extract and store paginationLinks. Return type changed to object with accounts and paginationLinks fields.
Package Version Update
components/mastodon/package.json
Version updated from 0.2.1 to 0.2.2.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify pagination parameter handling correctly passes max_id, min_id, and since_id to the API
  • Confirm return object structure (accounts and paginationLinks) matches expected output format
  • Validate Link header parsing logic for extracting pagination state

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding pagination props (maxId, minId, sinceId) to the Get Accounts Following action.
Description check ✅ Passed The description identifies what was added (pagination props) and references the related issue, but lacks detail on implementation approach and impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-19014-3

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/mastodon/actions/get-accounts-following/get-accounts-following.mjs (1)

63-81: Issue: paginationLinks may not correspond to the actual data returned when max limit is hit.

The paginationLinks variable is updated inside the loop (line 70) and will contain the Link header from the last API call. When the loop exits because accounts.length >= max, the results are trimmed to exactly max (lines 79-81), but paginationLinks still points to the continuation of the last fetched page, not to where the trimmed data actually ends.

Example:

  • max = 100
  • Fetch page 1: 80 accounts (total: 80)
  • Fetch page 2: 80 accounts (total: 160), paginationLinks set to page 2 links
  • Loop exits, trim to 100 accounts
  • Return 100 accounts with paginationLinks that would start from account 161+, not 101

Suggested fix:
Set paginationLinks to null or omit it when results are trimmed due to hitting the max limit, since the pagination links won't accurately represent the continuation point.

    if (accounts.length > max) {
      accounts.length = max;
+     paginationLinks = null; // Links don't correspond to trimmed data
    }

Also applies to: 84-87

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ba3f2b and ea051ec.

📒 Files selected for processing (2)
  • components/mastodon/actions/get-accounts-following/get-accounts-following.mjs (5 hunks)
  • components/mastodon/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: LucBerge
Repo: PipedreamHQ/pipedream PR: 14080
File: components/nocodb/nocodb.app.mjs:133-133
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When implementing pagination with an offset, incrementing `args.params.offset` within the loop ensures correct tracking of the offset, particularly when a maximum count limit (`max`) is used.

Applied to files:

  • components/mastodon/actions/get-accounts-following/get-accounts-following.mjs
🔇 Additional comments (4)
components/mastodon/package.json (1)

3-3: LGTM: Version bump aligns with pagination feature addition.

The patch version bump from 0.2.1 to 0.2.2 is appropriate for adding optional pagination props to the get-accounts-following action.

components/mastodon/actions/get-accounts-following/get-accounts-following.mjs (3)

7-7: LGTM: Version bump is appropriate.

Patch version increment to 0.0.3 correctly reflects the addition of optional pagination props.


84-87: Note: This is a breaking change for existing consumers.

The return value has changed from an array of accounts to an object containing { accounts, paginationLinks }. Existing workflows or code that consume this action will need to be updated to access .accounts instead of using the return value directly.

Ensure this breaking change is:

  1. Clearly documented in release notes or migration guides
  2. Communicated to users who may be using this action
  3. Justified by the pagination enhancement value

Additionally, ensure the paginationLinks accuracy issues identified in the previous comment are resolved.


22-39: The Mastodon API explicitly supports using these parameters together.

Since Mastodon v3.3.0, min_id and max_id can be used together on many endpoints. The parameters define boundaries, not conflicts: max_id returns results with ID < max_id (older items), while min_id returns results immediately newer than that ID. Using them together creates a valid range query with no conflicting constraints.

Likely an incorrect or invalid review comment.

Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @michelle0927, LGTM! Ready for QA!

@luancazarine luancazarine moved this from In Review to Ready for QA in Component (Source and Action) Backlog Nov 17, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to Ready for Release in Component (Source and Action) Backlog Nov 18, 2025
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Release

Development

Successfully merging this pull request may close these issues.

4 participants