lytics / ios-sdk

MIT License
0 stars 0 forks source link

Update LyticsConfiguration to include new config properties #82

Closed RaeEversmann closed 1 year ago

RaeEversmann commented 1 year ago

Add the following properties:

maxUploadRetryAttempts: Int = 1
requestUploadTimeout: Long = TimeUnit.SECONDS.toMillis(5)
maxLoadRetryAttempts: Int = 1
requestLoadTimeout: Long = TimeUnit.SECONDS.toMillis(5)
defaultTable: String = "user"

upload is for POST request load is for GET

mgacy commented 1 year ago

@RaeEversmann is the expectation that maxRetryAttempts and requestTimeout apply only to the personalization request or to the collect (and any future) requests as well?

RaeEversmann commented 1 year ago

Updated ticket based on slack feedback

mgacy commented 1 year ago

In the original ticket Mark suggested a default timeout of 5 seconds based on the expectation that it was unlikely the API would be unresponsive. However, on mobile issues are far more likely to arise from connectivity issues. On iOS, the default timeout interval for the URL Loading System is 60 seconds and the documentation includes the following recommendation:

As a general rule, you should not use short timeout intervals. Instead, you should provide an easy way for the user to cancel a long-running operation. For more information, read Designing for Real-World Networks in Networking Overview.

Beyond the question of the default value for the timeout, supporting a configurable timeout also adds complexity to the SDK.

As such, it was decided to remove support for requestUploadTimeout and requestLoadTimeout for the time being.