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

chore: handle 500kb limit, refactor to service impl #5302

Open
wants to merge 4 commits into
base: release/1.38.x
Choose a base branch
from

Conversation

yashasvibajpai
Copy link
Contributor

Description

On debugging for the issue, we came across the two pointers addressed here.

  • commas in JSON were unaccounted for in the final size of payload.
  • we will throw an error in case a single profile's size itself crosses the 500 kb threshold set by Klaviyo themselves. Reference

Linear Ticket

Related to INT-2820, INT-2840

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 36.11111% with 92 lines in your changes missing coverage. Please review.

Project coverage is 73.47%. Comparing base (94aa254) to head (f1fc997).

Files with missing lines Patch % Lines
...destinationmanager/klaviyobulkupload/apiService.go 12.76% 82 Missing ⚠️
...tionmanager/klaviyobulkupload/klaviyobulkupload.go 80.00% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.38.x    #5302      +/-   ##
==================================================
+ Coverage           73.40%   73.47%   +0.06%     
==================================================
  Files                 424      425       +1     
  Lines               60243    59965     -278     
==================================================
- Hits                44221    44058     -163     
+ Misses              13578    13435     -143     
- Partials             2444     2472      +28     

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


output := mockUploader.Upload(&common.AsyncDestinationStruct{
ImportingJobIDs: []int64{1, 2, 3},
testData := []byte(`{"message":{"body":{"JSON":{"data":{"type":"profile-bulk-import-job","attributes":{"profiles":{"data":[{"type":"profile","attributes":{"email":"[email protected]","first_name":"Testqwe0022","last_name":"user","phone_number":"+919902330123","location":{"address1":"dallas street","address2":"oppenheimer market","city":"delhi","country":"India","ip":"213.5.6.41"},"anonymous_id":"user1","jobIdentifier":"user1:1"}}]}},"relationships":{"lists":{"data":[{"type":"list","id":"list101"}]}}}}}},"metadata":{"jobId":1}}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

can use this from uploadData.jsonl instead of hard coding

@koladilip koladilip changed the base branch from release/1.38.x to master November 18, 2024 15:05
@koladilip koladilip changed the base branch from master to release/1.38.x November 18, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants