Skip to content

fix(selectors): paginate HubSpot owner options - #7359

Merged
waleedlatif1 merged 2 commits into
stagingfrom
investigate/hubspot-owner-pagination
Sep 1, 2026
Merged

fix(selectors): paginate HubSpot owner options#7359
waleedlatif1 merged 2 commits into
stagingfrom
investigate/hubspot-owner-pagination

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • paginate HubSpot owner options through the existing selector cursor contract
  • hydrate saved owners directly through the HubSpot owner detail endpoint
  • preserve active-owner filtering, credential binding, page limits, and abort propagation

Tests

  • pagination behavior: exposes the first continuation cursor, omits an archived fixture without dropping continuation, and forwards the supplied cursor as HubSpot after
  • direct-detail behavior: hydrates a saved owner by ID without traversing owner list pages

Validation

  • bun run --cwd apps/sim test -- lib/selectors/server/providers/hubspot.test.ts lib/webhooks/polling/hubspot.test.ts
  • ./node_modules/.bin/biome check apps/sim/lib/selectors/manifest.ts apps/sim/lib/selectors/server/providers/hubspot.ts apps/sim/lib/selectors/server/providers/hubspot.test.ts
  • bun run --cwd apps/sim type-check
  • bun run check:api-validation

Browser validation

  • With a connected HubSpot portal containing more than 100 owners, confirm Load more / Load all appears.
  • Select a later-page owner.
  • Save and reload, then confirm direct hydration preserves the owner label.

The available authenticated staging workspace has no connected HubSpot integration, so these portal-dependent checks remain pending.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 1, 2026 6:41pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR paginates HubSpot owner options through the selector cursor contract and adds direct detail hydration for saved owners.

  • Marks hubspot.owners as paginated and detail-capable in the selector manifest.
  • Fetches one active-owner page at a time while forwarding HubSpot continuation cursors.
  • Hydrates a saved owner directly by ID while preserving the requested selector identity.
  • Adds focused pagination, filtering, cursor-forwarding, and detail-hydration tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/selectors/manifest.ts Enables paginated list and direct-detail capabilities for the HubSpot owners selector.
apps/sim/lib/selectors/server/providers/hubspot.ts Replaces eager multi-page owner loading with cursor pagination and adds direct owner hydration while retaining active-owner filtering and credential-bound requests.
apps/sim/lib/selectors/server/providers/hubspot.test.ts Covers archived-owner filtering, continuation cursors, cursor forwarding, page limits, and preservation of saved IDs during direct hydration.

Sequence Diagram

sequenceDiagram
  participant UI as Owner selector
  participant S as HubSpot selector provider
  participant H as HubSpot API
  UI->>S: List request(cursor?)
  S->>H: "GET /crm/v3/owners?limit=100&after=cursor"
  H-->>S: Owners + next cursor
  S-->>UI: Active owner options + nextCursor
  UI->>S: Detail request(saved owner ID)
  S->>H: "GET /crm/v3/owners/{ID}"
  H-->>S: Owner details
  S-->>UI: Hydrated option preserving saved ID
Loading

Reviews (2): Last reviewed commit: "fix(selectors): preserve hydrated HubSpo..." | Re-trigger Greptile

Comment thread apps/sim/lib/selectors/server/providers/hubspot.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 3 files

Confidence score: 3/5

  • In apps/sim/lib/selectors/server/providers/hubspot.ts, sorting each cursor page independently can produce multiple alphabetized runs when HubSpot cursor order differs from generated labels, making the accumulated owner options appear incorrectly ordered; sort the complete accumulated option list after pagination.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/selectors/server/providers/hubspot.ts">

<violation number="1" location="apps/sim/lib/selectors/server/providers/hubspot.ts:238">
P2: Sort across the accumulated owner options rather than each cursor page independently. When HubSpot’s cursor order differs from the generated label order, appending the next page produces multiple alphabetized runs instead of one alphabetical owner list.</violation>
</file>

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/selectors/server/providers/hubspot.ts Outdated
Comment thread apps/sim/lib/selectors/server/providers/hubspot.ts
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptileai review the latest commit

@cubic-dev-ai review the latest commit

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@greptileai review the latest commit

@cubic-dev-ai review the latest commit

@BillLeoutsakosvl346 Incremental reviews are turned off for this repository. Comment @cubic review to run a full review.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@cubic review

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit e7cfef9 into staging Sep 1, 2026
27 checks passed
@waleedlatif1
waleedlatif1 deleted the investigate/hubspot-owner-pagination branch September 1, 2026 19:18
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.

2 participants