Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
(The more info the faster we will be able to address it!)
The issue is that the ON_APP_RESUME check frequency does not work as expected and always reports that the app is up to date.
I'm starting to suspect this is some kind of caching behavior built into Windows.Web.Http.HttpClient.
Immediately after an update, the first update check for the given hash usually comes back with a "no update" response. Then all subsequent checks (until app restart) return that same cached response. Just a theory...
Does it still repro if you disable caching in HttpClient in react-native-windows?
Unfortunately it still repros when I set cache-control: no-cache as a header on the HttpRequest object...
But I'm not convinced that's eliminating client-side caching, and I can't find a toggle for such behavior. I could try and add a random parameter (like DateTime) to the URI to see if it still caches...
Okay, so there is more evidence in favor of the client-side caching behavior. By adding a random parameter to the updateCheck URL, the correct response comes back. Now to figure out why HttpClient could be doing this...
Okay, by setting the following on the UWP HttpClient:
``` c#
var filter = new HttpBaseProtocolFilter
{
AllowAutoRedirect = false,
};
filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.MostRecent;
filter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;
return new DefaultHttpClient(new HttpClient(filter));
```
Things work properly. Unfortunately, setting EDIT: This is an issue with the Cache-Control header missing from the CodePush service response. Because CodePush can't really know the caching behavior of the underlying HTTP client, shouldn't it send a Cache-Control: no-cache should have also worked as expected. This is definitely a UWP bug, but I'm also curious if this could be a CodePush bug.Cache-Control: no-cache header from the service, or use a URI on the client that changes over time (e.g., by appending a Unix timestamp to the URI to prevent such caching)?
Confirmed that if the service responded with a "Cache-Control" header, then the HttpClient would do the right thing. I'll open another issue on http://github.com/Microsoft/code-push because I don't know where else to file service bugs.
Thanks for the service update @silhouettes, this works flawlessly now!