[Hubspot] Update hubspot custom event action to handle numeric strings#3523
Open
harsh-joshi99 wants to merge 1 commit intomainfrom
Open
[Hubspot] Update hubspot custom event action to handle numeric strings#3523harsh-joshi99 wants to merge 1 commit intomainfrom
harsh-joshi99 wants to merge 1 commit intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3523 +/- ##
==========================================
+ Coverage 80.25% 80.27% +0.02%
==========================================
Files 1275 1275
Lines 23484 23499 +15
Branches 4696 4701 +5
==========================================
+ Hits 18847 18864 +17
+ Misses 3762 3761 -1
+ Partials 875 874 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a schema mismatch issue in the HubSpot custom event action where numeric string values (e.g., "123") were being inferred as numbers during schema creation, but HubSpot had the corresponding properties defined as strings, causing validation errors.
Changes:
- Adds logic to detect when a property is inferred as a number but HubSpot expects a string, and converts the value to a string before sending
- Implements conversion for both cache hit scenarios (using cached schema) and cache miss scenarios (fetching from HubSpot)
- Adds comprehensive test coverage for various numeric string scenarios including single properties, multiple properties, partial matches, and verification that actual numbers remain unconverted
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
types.ts |
Adds numericStrings array to SchemaDiff type to track properties requiring conversion |
index.ts |
Adds call to convertNumericStrings for cache hits and passes payload to getSchemaFromHubspot for conversion |
hubspot-event-schema-functions.ts |
Implements numeric-to-string conversion logic when fetching schema from HubSpot, distinguishing string mismatches from other type mismatches |
cache-functions.ts |
Adds numericStrings tracking in compareSchemas and implements convertNumericStrings utility function |
index.test.ts |
Adds comprehensive test suite covering cache hits, cache misses, multiple numeric strings, partial property matches, and validation that actual numbers aren't converted |
abhandage
approved these changes
Jan 19, 2026
Contributor
Contributor
Author
f23b55f to
943227a
Compare
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.

In HubSpot custom event actions, numeric string values in properties were being inferred as numbers. When the corresponding property in HubSpot was actually defined as a string, this resulted in schema mismatch errors.
This PR updates the inference logic to correctly handle numeric strings. If a value is inferred as a number but the property type in HubSpot is a string, we convert the value back to a string before sending it.
JIRA -> https://twilio-engineering.atlassian.net/browse/STRATCONN-6467
Testing
Testing Document
Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.
Security Review
Please ensure sensitive data is properly protected in your integration.
type: 'password'