-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[STRATCONN-5603] - Format timestamp fields without miliiseconds #2816
Conversation
71a22d8
to
fe42d49
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2816 +/- ##
==========================================
- Coverage 78.54% 77.96% -0.59%
==========================================
Files 1095 1042 -53
Lines 21775 19007 -2768
Branches 4467 3704 -763
==========================================
- Hits 17104 14818 -2286
+ Misses 3362 2886 -476
+ Partials 1309 1303 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the timestamp conversion logic to remove milliseconds and adjusts error handling by explicitly typing error objects as GoogleAdsError. The changes include:
- Refining the convertTimestamp function to replace both the 'Z' suffix and milliseconds.
- Introducing explicit type casting for errors passed to handleGoogleAdsError in several functions.
- Adding unit tests to validate convertTimestamp functionality.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts | Enhancements to timestamp formatting and error handling type definitions. |
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/functions.test.ts | Added tests to cover the updated convertTimestamp function. |
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts
Outdated
Show resolved
Hide resolved
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts
Outdated
Show resolved
Hide resolved
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the timestamp conversion function to strip out milliseconds and enforce a standard timezone offset format while adding tests to verify the new behavior.
- Updated the convertTimestamp function to replace the trailing "Z" with a timezone offset.
- Added new unit tests covering timestamp conversion with and without milliseconds.
- Updated import statements in tests to include the new function.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts | Updated timestamp conversion logic for proper formatting without milliseconds |
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/functions.test.ts | Added test cases to verify convertTimestamp functionality |
30ea4b2
to
151aaf8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the timestamp conversion function to format timestamps without milliseconds by replacing the trailing "Z" with "+00:00", and refactors the way user address identifiers are constructed.
- Updated convertTimestamp to support timestamps with and without milliseconds.
- Refactored the construction of the addressInfo object to inline the processing of name and address fields.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts | Updates timestamp conversion regex and refactors construction of address identifiers. |
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/functions.test.ts | Adds unit tests for the updated convertTimestamp function. |
Comments suppressed due to low confidence (2)
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts:486
- Using the nullish coalescing operator to hash an empty string when first_name is missing may produce an unintended hash value. Consider conditionally adding the hashedFirstName property only when payload.first_name is provided.
hashedFirstName: processHashing(payload.first_name ?? '',
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts:494
- Using the nullish coalescing operator to hash an empty string when last_name is missing may produce an unintended hash value. Consider conditionally adding the hashedLastName property only when payload.last_name is provided.
hashedLastName: processHashing(payload.last_name ?? '',
530f457
to
dcffd66
Compare
This pull request updates timestamp conversion function to handle timestamps without milliseconds part.
Previously timestamp like
2025-03-11T17:57:29Z
was passed as is to google ads API. Google ads API expects timezone specified. Since a timestamp withZ
indicates UTC, as part of this change, we simply replace Z with +00.Adding unit test cases for timestamp formats with and without milliseconds
JIRA
Testing
Without milliseconds

With milliseconds