Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Sep 11, 2025

WHY

Resolves #18335

Summary by CodeRabbit

  • New Features

    • Added server‑side pagination to account, location, and review selectors, enabling smoother browsing of large lists and faster loading. Dropdowns now support fetching additional pages as you navigate.
  • Chores

    • Updated version metadata across Google My Business actions and sources. No user‑visible behavior changes.

@jcortes jcortes self-assigned this Sep 11, 2025
@vercel
Copy link

vercel bot commented Sep 11, 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 Sep 11, 2025 4:47pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 11, 2025 4:47pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Introduces server-side pagination for Google My Business account/location/review selectors by adding prevContext.pageToken handling and returning nextPageToken in options. Updates listAccounts/listLocations/listReviews method signatures to generic args/unknown returns. All other changes are version bumps across actions, sources, and package.json.

Changes

Cohort / File(s) Summary
Pagination + API refactor
components/google_my_business/app/google_my_business.app.ts
Added paginated async options using prevContext.pageToken and returning context.nextPageToken for account, location, and review selectors. Refactored listAccounts/listLocations/listReviews to accept generic args and return Promise<unknown>; removed specific types/imports tied to prior signatures. Updated HTTP request usage accordingly.
Action version bumps
components/google_my_business/actions/create-post/create-post.ts, .../create-update-reply-to-review/create-update-reply-to-review.ts, .../get-reviews-multiple-locations/get-reviews-multiple-locations.ts, .../get-specific-review/get-specific-review.ts, .../list-all-reviews/list-all-reviews.ts, .../list-posts/list-posts.ts
Bumped action version metadata only. No logic, props, or run-flow changes.
Source version bumps
components/google_my_business/sources/new-post-created/new-post-created.ts, .../new-review-created/new-review-created.ts, .../new-review-created-multiple-locations/new-review-created-multiple-locations.ts
Bumped source version metadata only. No changes to hooks, props, or behavior.
Package version bump
components/google_my_business/package.json
Incremented package version from 0.2.0 to 0.2.1.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as UI Selector
  participant App as GMB App (options)
  participant API as Google Business API

  User->>UI: Open selector (account/location/review)
  UI->>App: options({ prevContext: { pageToken } })
  App->>API: GET list(..., pageToken)
  API-->>App: items[], nextPageToken
  App-->>UI: options: items[], context: { nextPageToken }
  alt More pages
    User->>UI: Load more
    UI->>App: options({ prevContext: { pageToken: nextPageToken } })
    App->>API: GET list(..., nextPageToken)
    API-->>App: items[], nextPageToken'
    App-->>UI: items[], context: { nextPageToken' }
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks (3 passed, 2 warnings)

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR contains multiple metadata/version bumps across actions and sources and a package.json version increment that are unrelated to the pagination bug fix, and it also includes broader signature/typing changes to listAccounts/listLocations/listReviews that go beyond a focused pagination correction; these unrelated changes increase review surface and risk introducing unintended breaking changes. Split or justify the unrelated version/package metadata bumps into a separate release PR or explicitly document why they are included here, and either revert or clearly document and coordinate the public signature/typing changes (add migration notes, update dependents and tests) so reviewers can assess and accept the pagination fix without unexpected scope creep.
Description Check ⚠️ Warning The PR description only contains the WHY header with "Resolves #18335" and does not summarize what was changed, how the pagination fix was implemented, which files are affected (notably components/google_my_business/app/google_my_business.app.ts), or whether there are breaking API/signature changes and test/verification steps, so reviewers cannot easily assess scope or risk. Please expand the description to include a short implementation summary (e.g., server-side pagination via prevContext.pageToken/nextPageToken in account/location/review options), list public API/signature changes (notably listAccounts/listLocations/listReviews signature and return-type changes), note any breaking changes and required migration steps, and add testing or manual verification steps and links to related discussion or tests.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[FIX] Google My Business pagination" is concise, single-sentence, and directly reflects the primary purpose of the changes (fixing pagination for Google My Business async options), making it clear to reviewers and maintainers at a glance. It avoids noise and correctly scopes the PR to the affected feature.
Linked Issues Check ✅ Passed The changes implement server-side pagination for async options by adding prevContext.pageToken handling in account/location/review option props and returning a context with nextPageToken, which directly addresses the bug reported in [#18335]. These edits are present in components/google_my_business/app/google_my_business.app.ts and appear to enable fetching subsequent pages for async option lists. However, the PR also changes several public method signatures and return types (listAccounts/listLocations/listReviews) and relaxes typing, which is an ancillary change not requested in #18335 and should be validated with downstream consumers.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I nibble through pages, hop to and fro,
Tokens like carrots in a neat little row.
Accounts, locations—reviews in a chain,
“Load more,” I cheer, and bound down the lane.
A version bump breeze, pagination in sight—
The burrow runs deeper, and everything’s right. 🥕✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-google-business-prop-pagination

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 7

🧹 Nitpick comments (6)
components/google_my_business/actions/list-all-reviews/list-all-reviews.ts (1)

11-11: Version bump OK — guard $summary against non-array responses.

Replace response.length with Array.isArray(response) ? response.length : response?.reviews?.length ?? 0.
Location: components/google_my_business/actions/list-all-reviews/list-all-reviews.ts:44

components/google_my_business/sources/new-post-created/new-post-created.ts (1)

13-13: Version bump OK — paginate flag confirmed; add docs

Confirmed: components/google_my_business/app/google_my_business.app.ts defines async listPosts(..., paginate = true) and uses an if (paginate) branch — listPosts(params, false) disables pagination. Add a short JSDoc above listPosts stating the boolean disables pagination (default: true) and ensure the default behavior remains true after the version bump.

components/google_my_business/app/google_my_business.app.ts (4)

176-181: Type tightening (optional).
Keep signatures consistent with _httpRequest to improve DX.

Apply:

-    listAccounts(args: object = {}): Promise<unknown> {
+    listAccounts(args: Omit<HttpRequestParams, "url"> = {} as Omit<HttpRequestParams, "url">): Promise<object> {

117-121: Minor: labels for reviews rely on title.
If titles are sometimes empty, consider fallback to name snippet. Optional.

-          label: title,
+          label: title || this.getCleanName(name) as string,

139-141: Header merge (optional).
Current spread overwrites any caller-provided headers. Consider merging to preserve them while ensuring Authorization wins.

-        headers: this._getHeaders(),
+        headers: { ...(args as any).headers, ...this._getHeaders() },

151-151: Type correctness (optional).
Initialize pageToken as possibly undefined to satisfy TS and reflect first-page call.

-      let pageToken: string;
+      let pageToken: string | undefined;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4e584e and 46238a0.

📒 Files selected for processing (11)
  • components/google_my_business/actions/create-post/create-post.ts (1 hunks)
  • components/google_my_business/actions/create-update-reply-to-review/create-update-reply-to-review.ts (1 hunks)
  • components/google_my_business/actions/get-reviews-multiple-locations/get-reviews-multiple-locations.ts (1 hunks)
  • components/google_my_business/actions/get-specific-review/get-specific-review.ts (1 hunks)
  • components/google_my_business/actions/list-all-reviews/list-all-reviews.ts (1 hunks)
  • components/google_my_business/actions/list-posts/list-posts.ts (1 hunks)
  • components/google_my_business/app/google_my_business.app.ts (4 hunks)
  • components/google_my_business/package.json (1 hunks)
  • components/google_my_business/sources/new-post-created/new-post-created.ts (1 hunks)
  • components/google_my_business/sources/new-review-created-multiple-locations/new-review-created-multiple-locations.ts (1 hunks)
  • components/google_my_business/sources/new-review-created/new-review-created.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/google_my_business/app/google_my_business.app.ts (1)
components/google_my_business/common/responseSchemas.ts (3)
  • Account (9-12)
  • Location (5-7)
  • Review (18-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (13)
components/google_my_business/actions/list-posts/list-posts.ts (1)

12-12: Version bump only — listPosts still returns an array (Promise<LocalPost[]>)

Confirmed: components/google_my_business/app/google_my_business.app.ts declares async listPosts(...): Promise<LocalPost[]>; callers in components/google_my_business/actions/list-posts/list-posts.ts and components/google_my_business/sources/new-post-created/new-post-created.ts call this.app.listPosts(...) and expect an array. No changes needed.

components/google_my_business/actions/get-reviews-multiple-locations/get-reviews-multiple-locations.ts (1)

11-11: Version bump OK — location propDefinition supports pagination

components/google_my_business/app/google_my_business.app.ts: the "location" propDefinition's async options accept prevContext.pageToken and return context.pageToken = response?.nextPageToken (and the action's locationNames prop reuses that definition as a string[]), so multi-select pagination is supported.

components/google_my_business/actions/get-specific-review/get-specific-review.ts (1)

11-11: Version bump OK — verify "review" prop pagination

rg shows a listReviews call passing params.pageSize=50 and a listReviews implementation in components/google_my_business/app/google_my_business.app.ts (call ≈lines 97–105; impl ≈lines 190–194), but no propDefinition for app "review" was found — confirm the propDefinition wires params.pageToken into the list call and that pageToken is advanced/forwarded on subsequent requests so pages actually paginate.

components/google_my_business/sources/new-review-created/new-review-created.ts (1)

13-13: Verify listReviews return type after version bump

Source version bump is fine — confirm app.listReviews still returns Review[] (not unknown or a paginated wrapper). If it returns a wrapper/unknown, tighten the types or add a safe cast.

Locations: components/google_my_business/app/google_my_business.app.ts (refs at ~101, ~190); Review interface: components/google_my_business/common/responseSchemas.ts:18.

components/google_my_business/sources/new-review-created-multiple-locations/new-review-created-multiple-locations.ts (1)

16-16: Version bump only — LGTM.

No functional changes in this file.

components/google_my_business/actions/create-post/create-post.ts (1)

15-15: LGTM: version bump only.
No behavioral changes introduced.

components/google_my_business/actions/create-update-reply-to-review/create-update-reply-to-review.ts (1)

11-11: LGTM: version bump only.
No functional changes.

components/google_my_business/app/google_my_business.app.ts (6)

5-6: Imports look consistent with new usages.
HttpRequestParams, PaginatedRequestParams, etc., are referenced below.


26-31: Usage of listAccounts is fine once prevContext is optional.
No further changes needed here.


31-38: Options mapping looks good.
Labels and values are sensible.


38-43: Consistent pagination context return.
Good: nextPageToken ?? null. Matches sentinel usage.


65-73: Query filter and readMask look correct for BI API.
No change requested.


82-86: Good: returns options with pagination context.
Matches account/location patterns.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@vunguyenhung vunguyenhung merged commit 2c07c98 into master Sep 12, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the fix-google-business-prop-pagination branch September 12, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Google My Business pagination

4 participants