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

add new headers #165

Merged
merged 10 commits into from
Apr 10, 2024
Merged

add new headers #165

merged 10 commits into from
Apr 10, 2024

Conversation

ndurell
Copy link
Contributor

@ndurell ndurell commented Mar 22, 2024

  • mobile header indicating traffic coming from mobile sdk
  • retry attempt header indicating number of retries

Description

Check List

  • Are you changing anything with the public API?
  • Have you tested this change on real device?
  • Are your changes backwards compatible with previous SDK Versions?
  • Have you added unit test coverage for your changes?
  • Have you verified that your changes are compatible with all the operating system version this SDK currently supports?

Manual Test Plan

Supporting Materials

@ndurell ndurell requested a review from a team as a code owner March 22, 2024 19:18
@ndurell ndurell requested a review from evan-masseau March 22, 2024 19:18
@@ -49,6 +49,7 @@ struct KlaviyoAPI {
requestFailed(request, error, 0.0)
return .failure(.internalRequestError(error))
}
urlRequest.allHTTPHeaderFields?["X-Klaviyo-Retry-Attempt"] = "\(attemptNumber)/50"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe could use a constant here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be super sure, this header should be formatted 1/50 -> 50/50 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yah that was my understanding...could totally have missed that detail though!

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense to me, just want to be sure we don't accidentally start at 0 (or end at 49)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yah I'm going to test it through and ensure it does the desired thing.

Copy link
Contributor

@evan-masseau evan-masseau Apr 2, 2024

Choose a reason for hiding this comment

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

@ndurell Lets name this header X-Klaviyo-Attempt-Count then?

Choose a reason for hiding this comment

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

I think we landed on

X-Klaviyo-Retry-Attempt

Earlier

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah its a nitpick, but just responding to the above thread, that name is a little ambiguous: is 1/50 the first retry or first attempt.

Choose a reason for hiding this comment

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

I see, no issues here then

Copy link
Contributor

Choose a reason for hiding this comment

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

Starting from 1 now. Still doing some testing on my end but so far it's looking good.

Also, renamed header to X-Klaviyo-Attempt-Count

ndurell added 4 commits April 1, 2024 18:59
* mobile header indicating traffic coming from mobile sdk
* retry attempt header indicating number of retries
@ndurell ndurell force-pushed the noah/CHNL-6823/new-headers-for-ios branch from 8223b86 to 9ddcfe8 Compare April 1, 2024 23:05
@evan-masseau
Copy link
Contributor

For viz, the related android PR

Copy link
Contributor

@evan-masseau evan-masseau left a comment

Choose a reason for hiding this comment

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

Rename to X-Klaviyo-Attempt-Count

@ajaysubra
Copy link
Contributor

Rename to X-Klaviyo-Attempt-Count

Done. Let me know if it looks good.

▿ some: 1 key/value pair
▿ (2 elements)
- key: "X-Klaviyo-Retry-Attempt"
- value: "0/50"
Copy link
Contributor

Choose a reason for hiding this comment

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

When an actual device sends, the first send will be 1/50, ya?
I had to do this in my tests too, just want to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like he didn't update tests yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah I see now, it failed CI

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I tested this using a proxy, it starts at 1. I will update the tests.

Copy link
Contributor

@evan-masseau evan-masseau left a comment

Choose a reason for hiding this comment

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

LGTM once tests are fixed

@ajaysubra ajaysubra merged commit 45ec195 into master Apr 10, 2024
8 of 9 checks passed
@ajaysubra ajaysubra deleted the noah/CHNL-6823/new-headers-for-ios branch April 10, 2024 15:28
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.

4 participants