Skip to content
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

Reduce startup delay #31

Closed
minusnine opened this issue Dec 17, 2023 · 5 comments · Fixed by #49
Closed

Reduce startup delay #31

minusnine opened this issue Dec 17, 2023 · 5 comments · Fixed by #49
Assignees
Labels
enhancement New feature or request

Comments

@minusnine
Copy link

While I'm on my bike, I'd like to be able to press a few buttons on my watch without looking to open the garage door. However, there is sometimes a several second delay between launching the HomeAssistant app and the menu rendering, and this delay is variable.

I believe this is because the app performs a synchronous HTTP GET to retrieve the configuration.

My configuration is currently stored in Home Assistant's web server, accessed via Nabu Casa. While I suppose I could deploy some edge caching to speed up the Internet part of this operation, this seems less optimal than caching the configuration within the app itself. Of course, with caching comes the cache invalidation problem.

Would you consider some means to allow the user to cache this information to reduce latency?

One idea would be to require the user to explicitly refresh the configuration via an App-provided menu item on the watch. This might be opt-in and enabled only if the user has made a configuration setting through ConnectIQ to disable prefetching.

Another idea would be to add this into the user-provided JSON configuration, such that on subsequent launches, the configuration file is not refreshed automatically, only on-demand.

An extension of this idea would be to add -- in addition to menu item for manual use -- a background, periodic callback to refresh the configuration every N minutes, for some N.

@philipabbey
Copy link
Collaborator

philipabbey commented Jan 1, 2024

Hello @minusnine!

Thank you for your interest in the application.

I believe this is because the app performs a synchronous HTTP GET to retrieve the configuration.

All responses to a call to makeWebRequest are asynchronous, meaning once they are fired off, the application continues, but it can't do much without the response!

Would you consider some means to allow the user to cache this information to reduce latency?

Under different circumstances - yes. However we are limited in what we can offer in a watch environment. Presently, I'm trying desparately to reduce the memory footprint in order to continue supporting some older devices. As a result there will be no room for new features.

Sorry.

@philipabbey philipabbey closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2024
@philipabbey philipabbey reopened this Jan 2, 2024
@philipabbey
Copy link
Collaborator

Might trial this to see if it saves a noticeable amount of time given the toggle states still need updating anyway.

@philipabbey philipabbey added the enhancement New feature or request label Jan 4, 2024
@philipabbey
Copy link
Collaborator

Simulation of a Vivoactive 3 device without debug:

Error: Out Of Memory Error
Details: Failed invoking <symbol>
Stack: 
  - initialize() at 

Encountered app crash.

Pity as I had it working quite nicely.

@philipabbey philipabbey self-assigned this Jan 8, 2024
@philipabbey
Copy link
Collaborator

So the memory issues might just be down to struggling to force the SDK to compile without debug.

@philipabbey philipabbey linked a pull request Jan 9, 2024 that will close this issue
@minusnine
Copy link
Author

@philipabbey Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants