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

Session and task descriptions #286

Merged

Conversation

hishma
Copy link
Contributor

@hishma hishma commented Mar 7, 2024

This pull request updates the Apollo URLSessionClient adding the ability to optionally provide a session description and/or task description to the URLSession , and any subsequent URLSessionTask ’s created by the session.

These are helpful when debugging, especially when analyzing HTTP traffic with Instruments.

See also:

Provides an optional `sessionDescription` to the `URLSessionClient` initializer. If provided this will be added to the underlying `URLSession` to aid in debugging.

See: https://developer.apple.com/documentation/foundation/urlsession/1408277-sessiondescription
Provides an optional `taskDescription` to `URLSessionClient.sendRequest(_:_:_:_:)`.
If provided this will be added to the returned `URLSessionTask` where it can be used for debugging purposes.

See: https://developer.apple.com/documentation/foundation/urlsessiontask/1409798-taskdescription

Note: Not to be conflated with the `taskIdentifier`.
@hishma hishma requested a review from a team as a code owner March 7, 2024 15:45
@apollo-cla
Copy link

@hishma: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link

netlify bot commented Mar 7, 2024

👷 Deploy request for eclectic-pie-88a2ba pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ac251ad

Copy link

netlify bot commented Mar 7, 2024

👷 Deploy request for apollo-ios-docc pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ac251ad

Copy link
Contributor

@AnthonyMDev AnthonyMDev left a comment

Choose a reason for hiding this comment

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

This seems good to me! Thanks for the addition and for adding tests for it!

@AnthonyMDev
Copy link
Contributor

Actually, this may be a breaking change this way since sendRequest is an open function (overrides in subclasses will need to be changed). We need to keep the old version of the function and add this as a second overload.

I can make those changes though.

@AnthonyMDev AnthonyMDev enabled auto-merge (squash) March 8, 2024 18:02
@AnthonyMDev AnthonyMDev merged commit 61e0153 into apollographql:main Mar 8, 2024
14 checks passed
BobaFetters pushed a commit that referenced this pull request Mar 8, 2024
BobaFetters pushed a commit to apollographql/apollo-ios that referenced this pull request Mar 8, 2024
BobaFetters pushed a commit that referenced this pull request Mar 8, 2024
569f814 Session and task descriptions (#286)

git-subtree-dir: apollo-ios
git-subtree-split: 569f814
BobaFetters pushed a commit that referenced this pull request Mar 8, 2024
git-subtree-dir: apollo-ios
git-subtree-mainline: cfc0d16
git-subtree-split: 569f814
AnthonyMDev added a commit that referenced this pull request Mar 8, 2024
@hishma hishma deleted the session-and-task-descriptions branch March 9, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants