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

Added fileRequestTimeout config property. #329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcin-cebo
Copy link
Contributor

No description provided.

@@ -31,7 +31,8 @@ class RetrofitManager(
private val configuration: PNConfiguration,
@get:TestOnly internal var transactionClientInstance: OkHttpClient? = null,
@get:TestOnly internal var subscriptionClientInstance: OkHttpClient? = null,
@get:TestOnly internal var noSignatureClientInstance: OkHttpClient? = null,
@get:TestOnly internal var noSignatureClientInstanceForFiles: OkHttpClient? = null,
@get:TestOnly internal var signatureClientInstanceForFiles: OkHttpClient? = null
Copy link
Contributor

Choose a reason for hiding this comment

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

is this actually used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used in test: retrofit manager created from another has shared OkHttpClients data

Copy link
Contributor

Choose a reason for hiding this comment

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

so if it's not used in production code for anything, do we need it?

*
* The value is in seconds.
*
* Defaults to 300 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

OkHttp has a good reason for defaulting this to 0 (no limit),
do we really have a reason to default this to anything else (and introduce a breaking change for users of our SDK)?

Copy link
Contributor Author

@marcin-cebo marcin-cebo Jan 20, 2025

Choose a reason for hiding this comment

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

JS has it set to 300 by default. I was using JS a reference point to keep cross SDK consistence.

I guess some changes for existing users are inevitable.
Currently users uses nonSubscribeReadTimeout to set readTimeout for Files related operation.
After change nonSubscribeReadTimeout will not be taken into account readTimeout will 0 (no limit)
and if user upgrade they will get default value for fileRequestTimeout

What do you think?

Copy link
Contributor

@wkal-pubnub wkal-pubnub Jan 21, 2025

Choose a reason for hiding this comment

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

we discussed on daily, and we don't have to have consistency because we have different (better) timeouts we can use that JS and iOS don't have access to.
We should expose connect and read timeouts for file downloads as well, and the request timeout should be 0 (no limit) by default.

@@ -156,6 +157,7 @@ class PNConfigurationImplTest {
assertEquals(3, configuration.subscribeTimeout)
assertEquals(4, configuration.connectTimeout)
assertEquals(5, configuration.nonSubscribeRequestTimeout)
assertEquals(10, configuration.fileRequestTimeout)
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated, but looks like this test is missing authToken that we've added some time ago

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add this.

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