Skip to content
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-4282] Braze validation and multi-status fix #2521

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sayan-das-in
Copy link
Contributor

Context
Earlier Braze required on the the 3 fields to be present to be considered an event to be valid, they were braze_id, user_alias and external_id. Later email was added, however this validation was missing from the MultiStatus flow.

PR Contents

  • Adds email as one of the required fields
  • Fixes couple of error messages to represent that email is one the fields used in validation
  • Fixes a MultiStatus bug where sent was to the original batch payload instead of what was actually sent.

Testing

Testes locally.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

@sayan-das-in sayan-das-in marked this pull request as ready for review October 21, 2024 16:27
@sayan-das-in sayan-das-in requested a review from a team as a code owner October 21, 2024 16:27
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.00%. Comparing base (09e84ae) to head (211d60c).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2521      +/-   ##
==========================================
- Coverage   78.78%   78.00%   -0.79%     
==========================================
  Files        1052      991      -61     
  Lines       20503    17388    -3115     
  Branches     4228     3281     -947     
==========================================
- Hits        16153    13563    -2590     
+ Misses       3256     2737     -519     
+ Partials     1094     1088       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -179,7 +184,7 @@ export async function sendBatchedTrackEvent(
})

await handleBrazeAPIResponse(
transformPayloadsType(payloads),
payloads as object as JSONLikeObject[],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems stylistic. How risky is it? Should we leave it out to reduce the number of variables we're changing in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply a type definition. The transformPayloadsType function was previously used only to change the type. However, since type information is removed during the compilation from TypeScript to JavaScript, this would result in an extra, non-functional function being left behind.

@brennan brennan requested a review from a team October 21, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants