Repository navigation
Snapshot caching causes incorrect preview image age counter in Apple Home’s preview #2172
dougasimpson
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the behavior
The Snapshot plugin can supply HomeKit with a cached image up to one hour old for an ordinary camera. In testing, when a camera went offline, Home repeatedly displayed that cached image with a counter progressing from “Now” to approximately 11 seconds. Each successful refresh returned the same old image and reset the counter. A camera that had been offline for 45 minutes therefore appeared to have a preview only 0–11 seconds old, rather than showing its actual age.
The camera console confirmed:
Cached responses can also understate preview age while a camera is online. The approximately 11-second refresh cycle was observed during testing; it is not necessarily a fixed HomeKit interval.
To reproduce
Expected behavior
After the camera has been offline, Home should display an appropriately aged preview counter, such as “45m,” rather than continually cycling between “Now” and 11 seconds.
The counter represents time since Home’s last successful preview. When that preview was acquired immediately before disconnection, it should reflect approximately how long the camera has been offline. In our tests without the Snapshot plugin’s fallback, Home provided this behavior natively.
Home should also control whether it retains the last good preview or displays an unavailable state. Scrypted should report acquisition failure rather than successfully return a generated “Snapshot Failed” image.
Proposed fix
Add a global Require Fresh HomeKit Snapshots setting, enabled by default, that:
Implementation: PR #2171.
Testing completed
The proposed fix has completed our automated and physical-camera test plan:
Environment
All reactions