source-intercom-native: add config option to use /companies/scroll
endpoint
#2256
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.
Description:
Intercom has two separate endpoints for retrieving companies:
/companies/list
(limited to 10k companies) and/companies/scroll
(limited to only one "scroll" happening at a time). For users that have more than 10k companies in their Intercom account, they will need to use the/companies/scroll
endpoint to ensure no data is missed.The connector previously always used the
/companies/list
endpoint, and this PR adds the ability to use the/companies/scroll
endpoint instead. The newuse_companies_list_endpoint
config option controls which of the two company-related endpoints are used. Within the connector, anasyncio.Lock
is used to avoid attempting concurrent "scrolls" between the two streams that want to use/companies/scroll
-companies
andcompany_segments
.The connector defaults to using
/companies/scroll
, preferring to capture all data instead of potentially missing data if the user has >10k companies.It may be worthwhile to remove the option to use
/companies/list
at a later date. The main reasons I anticipate users would check theuse_companies_list_endpoint
option are:/companies/scroll
that they can't disable (not sure how common that is)companies
andcompany_segments
(which seems relatively negligible with the limited testing I've done)Workflow steps:
(How does one use this feature, and how has it changed)
Documentation links affected:
source-intercom-native
connector docs should be updated to reflect the newuse_companies_list_endpoint
config option.Notes for reviewers:
Tested on a local stack. Confirmed:
_scroll_companies
function.companies
andcompany_segments
streams do not concurrently try to hit/companies/scroll
.use_companies_list_endpoint
config option controls whether/companies/list
or/companies/scroll
is used./companies/scroll
but receives a400
response indicating some other application is using the endpoint.This change is