fix(selectors): paginate HubSpot owner options - #7359
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR paginates HubSpot owner options through the selector cursor contract and adds direct detail hydration for saved owners.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| 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
Reviews (2): Last reviewed commit: "fix(selectors): preserve hydrated HubSpo..." | Re-trigger Greptile
There was a problem hiding this comment.
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
|
@greptileai review the latest commit @cubic-dev-ai review the latest commit |
@BillLeoutsakosvl346 Incremental reviews are turned off for this repository. Comment |
|
@cubic review |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
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
Summary
Tests
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.tsbun run --cwd apps/sim type-checkbun run check:api-validationBrowser validation
The available authenticated staging workspace has no connected HubSpot integration, so these portal-dependent checks remain pending.