fix(hubspot): listContacts omits null after so it can paginate past page 1#93
Merged
Merged
Conversation
… page 1 listContacts always put `after` in the query string, defaulting it to null when no cursor was supplied. HubSpot's GET /crm/v3/objects/contacts rejects `after=null` (and `after=`) with a 400, so callers could never page past the first page — forcing them onto the search endpoint, which is hard-capped at 10,000 results and unusable for full-contact enumeration on large portals. Only include `after` in the query once a cursor is actually present (second page onward). First-page calls now send just limit + properties. Adds unit tests for first page (no after), subsequent pages, and null after. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Contributor
|
🚀 PR was released in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Api.listContactsalways placesafterin the query string, defaulting it tonullwhen no cursor is supplied:HubSpot's
GET /crm/v3/objects/contactsrejectsafter=null(andafter=) with a 400, so a caller can never page past the first page. The practical fallout: integrations are forced onto the search endpoint for full enumeration, which HubSpot hard-caps at 10,000 results — so any portal with >10k contacts cannot be fully listed. (We hit exactly this: a 100k-contact initial sync died atfetched=10000.)Fix
Only include
afterin the query once a cursor is actually present (i.e. from the second page onward). First-page calls now send justlimit+properties; subsequent pages send thepaging.next.aftercursor.Tests
New
tests/listContacts.test.js(fast unit tests stubbing_get, since the existingapi.test.jsis live-OAuth):afterafteris sentafter: null→ treated as "no cursor"🤖 Generated with Claude Code
Version
Published prerelease version:
@friggframework/api-module-hubspot@2.0.0-next.6Changelog
🚀 Enhancement
@friggframework/api-module-microsoft-teams,@friggframework/api-module-slack,@friggframework/api-module-42matters,@friggframework/api-module-asana,@friggframework/api-module-attio,@friggframework/api-module-clio,@friggframework/api-module-connectwise,@friggframework/api-module-contentful,@friggframework/api-module-contentstack,@friggframework/api-module-crossbeam,@friggframework/api-module-deel,@friggframework/api-module-frigg-scale-test,@friggframework/api-module-frontify,@friggframework/api-module-google-calendar,@friggframework/api-module-google-drive,@friggframework/api-module-helpscout,@friggframework/api-module-hubspot,@friggframework/api-module-ironclad,@friggframework/api-module-linear,@friggframework/api-module-pipedrive,@friggframework/api-module-salesforce,@friggframework/api-module-stripe,@friggframework/api-module-unbabel-projects,@friggframework/api-module-unbabel,@friggframework/api-module-zoho-crm,@friggframework/api-module-zoom@friggframework/api-module-microsoft-teams,@friggframework/api-module-slack,@friggframework/api-module-42matters,@friggframework/api-module-asana,@friggframework/api-module-attio,@friggframework/api-module-connectwise,@friggframework/api-module-contentful,@friggframework/api-module-contentstack,@friggframework/api-module-crossbeam,@friggframework/api-module-deel,@friggframework/api-module-frigg-scale-test,@friggframework/api-module-frontify,@friggframework/api-module-google-calendar,@friggframework/api-module-google-drive,@friggframework/api-module-helpscout,@friggframework/api-module-hubspot,@friggframework/api-module-ironclad,@friggframework/api-module-linear,@friggframework/api-module-pipedrive,@friggframework/api-module-salesforce,@friggframework/api-module-stripe,@friggframework/api-module-unbabel-projects,@friggframework/api-module-unbabel,@friggframework/api-module-zoho-crm,@friggframework/api-module-zoom🐛 Bug Fix
@friggframework/api-module-hubspotafterso it can paginate past page 1 #93 (@d-klotz)Authors: 1