Updating an application that uses ODR from Xcode or 'ad hoc' webserver renders ODR cached and non-updatable

Originator:borissotillos
Number:rdar://24409763 Date Originated:29-Jan-2016 04:46 PM
Status:open Resolved:
Product:tvOS SDK Product Version:apple TV 9.1 (13U85)
Classification: Reproducible:100%
 
Boris Sotillos
29-Jan-2016 04:46 PM

Summary:
Attached you will find 2 versions of the same tvOS application.
- Compiled in debug, they produce an application that relies on Xcode debugger to do the ODR simulation.
- Compiled in release, they produce an application that uses a web server to download the ODR files.
To run the latter, you will need to archive the application, do the export process and set up an "ad hoc" web server appropriately. You may have to modify the project to point to your web server.

Both versions have an ODR catalog. The relevant assets are:
- "d1" is the same in both versions
- "d2" is different on each version.
- "d3" is present only on version 2.

All assets are small text files.
The content of the files is dumped during execution to the device log, to help in identifying what was just being downloaded.

The issue is:
After installing one version and running it -downloading ODR- and then installing the other version and running it, we get the ODR from the first version. As if it was cached.

Installing/updating the applications via Xcode's Device Window also causes the issue.

Doing the initial installation over Xcode/Device Window (and running it) will also cause the issue, even if the updated version was installed from store/TestFlight. The moment something is downloaded, the "caching" happens.

Steps to Reproduce:
In both debug or release (ODR via Xcode simulation or via a web server), the behaviour is the same, on the same steps:
1) Uninstall application. This should get rid of the ODR files as well.
2) Install v1.
3) Run it. Wait for it to complete(*). Kill application.
4) Check logs. It should download "d1" and "d2".
5) Install v2. To simulate an update.
6) Run it. Wait for it to complete(*). Kill application.
7) Check logs. It should download "d2" and "d3".  ----> BUT it doesn't. Application behaves as if ODR was the same as in v1.

(*) Regarding the "wait for it to complete" instructions above.: Testing this on tvOS 9.2 beta 2, we have seen that downloads take over 1 minute to complete. seems that beginAccessingResourcesWithCompletionHandler waits for (exactly) 1 minute before issuing the actual HTTP GET request. This happens both with Xcode simulated downloads and a web server. We are opening a separate bug on this.

Expected Results:
ODR to work the same no matter how the application was installed.

Actual Results:
After the repro steps, application behaves as if ODR was the same as in v1.
Seems that once ODR is downloded, something gets cached an it can't be updated.

Version:
tvOS 9.2 (13Y5189e)

Notes:
We don't get this behaviour when doing the initial installation and the application update from the appStore of the TestFlight application. In that case, ODR is updated as expected.
We believe (this is pure speculation) that unless installing from the store or TestFlight, some ODR meta information is cached in the device, rendering next updates unable to update the ODR.


Configuration:
ATV over LAN

Attachments:
'odrup.rar' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!