-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: use new header to set polling interval #519
Conversation
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
I see the lint/formatter CI check is failing. I checked the CI job and I think the lint/formatter is failing in the diff check. Indicating that the formatting you ran on your development machine is different from what the CI generated. Perhaps your development environment is not up-to-date with the latest tooling this code base uses? If you could double check this doc to see if you have the |
In regards to the sample apps not compiling, the CI job fails with error message, "Could not install WWDR certificate". This is a known issue with the tools that we use to compile our apps. It doesn't happen too often so retrying the CI job takes care of it most of the time. |
@@ -31,7 +32,7 @@ enum BaseNetwork { | |||
URLSession.shared.dataTask(with: urlRequest, completionHandler: { data, response, error in | |||
if let error = error { completionHandler(.failure(error)) } | |||
guard let data = data, let response = response as? HTTPURLResponse, | |||
(200 ... 299).contains(response.statusCode) | |||
(200 ... 304).contains(response.statusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
304
is content not modified, I know we were relying on it before but were returning failure
apparently, so just wanted to check nothing breaks from before right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change, we used to rely on the default NSURLSession
's behavior to cache any 304 responses, it used to take 304s and convert them to the latest 200 responses automatically, we can't have that anymore because otherwise, the new header would be part of that cached response.
if let newPollingIntervalString = headers["x-gist-queue-polling-interval"] as? String, | ||
let newPollingInterval = Double(newPollingIntervalString), | ||
newPollingInterval != Gist.shared.messageQueueManager.interval { | ||
DispatchQueue.main.async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need DispatchQueue.main
here? because the method setup
is also using DispatchQueue.main.asyncAfter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using that because of the polling timer being created in the setup
call.
## [2.12.0](2.11.1...2.12.0) (2024-02-15) ### Features * use new header to set polling interval ([#519](#519)) ([05a1ebd](05a1ebd))
Updates the polling interval remotely through the new X-Gist-Queue-Polling-Interval header.
Part of: INAPP-12243