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

Make URLSession Configurable #927

Open
tobihagemann opened this issue Apr 30, 2024 · 4 comments
Open

Make URLSession Configurable #927

tobihagemann opened this issue Apr 30, 2024 · 4 comments

Comments

@tobihagemann
Copy link

Is your feature request related to a problem? Please describe.

We are unable to configure the URLSession beyond the default settings, see:

private lazy var session = URLSession(configuration: URLSessionConfiguration.default, delegate: nil, delegateQueue: nil)

This restricts our ability to create background URLSessions with custom configurations, particularly concerning setting session identifiers and shared container identifiers.

Describe the solution you'd like

We propose updating the BoxNetworkAgent to create the URLSession based on some sort of configuration. One way could be to extend the BoxSDKConfiguration to accept a URLSessionConfiguration.

Describe alternatives you've considered

There isn't really an alternative. Since we're implementing a File Provider extension, we require the URLSessions to be configured as a background session.

Additional context

We are willing to contribute to implementing this feature and are open to creating a pull request. However, we would appreciate guidance from you to ensure the feature aligns with your best practices for your library.

@arjankowski
Copy link
Contributor

Hi @tobihagemann,

Absolutely, I encourage you to contribute to the project 💯 As you've probably noticed, we strive to avoid introducing breaking changes in the project. Additionally, it's a requirement for incoming changes to have test coverage.

But before you embark on that journey, I'll just mention that we're currently putting a lot of effort into the new box-swift-sdk-gen🚀, which should be officially released this year. It's entirely generated using our tool, which creates the SDKs based on our public API. As of now, the project is fully functional, but we're constantly developing it, which may result in breaking changes, though they shouldn't be significant.

@arjankowski
Copy link
Contributor

In the new SDK, when creating a BoxClient, you can pass a NetworkSession, which accepts the parameter URLSessionConfiguration that you mentioned here. You can find more information at this link.

@tobihagemann
Copy link
Author

Oh, we didn't know about this new SDK. 😮 And indeed, it would probably already solve our issue if you're able to pass a URLSessionConfiguration. I guess, we'll take a look at it. Will there be a new tag in the near future, or will it stay at v0.1.0 for a while? Or what would you recommend for us?

@arjankowski
Copy link
Contributor

Hi @tobihagemann,
I've just released a new version v0.2.0, which includes our latest changes, so I recommend using it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants