5Zone widget and Async HTTP requests #304
Labels
No labels
bug
conflicts
documentation
DO NOT MERGE
duplicate
enhancement
good first issue
hardware
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
greg/info-orbs#304
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While testing the 5zone widget, startup seems to take a lot longer due to waiting for initial time zone API requests. Those API requests also seem to be locking up the UI in some cases. These requests should be done async using TaskManager so startup is not delayed and UI doeesnt get locked up. Also should include a default Loading message while the API's are returning.
Oh boy, the code quality and testing before even thinking to create a Pull Request is getting lower and lower when i once created my PR‘s :( Maybe it will get better in the future.
Thanks for this @dreed47, my bad for not catching this while merging. I'll work to see if I can fix on my end.
@HugoBalder while I appreciate the sentiment of your comment it's not helpful.
This is an open source project with folks of varying skill levels (of which I am on the lower end of) that I am doing my best to accommodate and make sure all willing to contribute are able to do so, and I'm still learning!
Suggestions, feedback, changes and help are VERY welcomed(+encouraged!!) and I do my best to accommodate any and all of them, however empty criticism is not helpful.
Hi @dreed47
Thanks for the feedback, I'll have a look at moving to TaskManager for the API loading.
One point to consider is what is better to have a longer load time and showing correct data or loading quickly and not showing correct because the TZs have not been loaded?
I see this sometimes on the stock widget, if you start your Orb and quickly scroll to the stockwidget you get the "loading data" message flashes across the screens very quickly..
At present there is the standard loading message as per the other widgets, what message are you referring too?
I didn't realize there was already a loading messages. I just didn't see them. I get your point about having data preloaded but as a general rule any long running operation like an http request should be done async otherwise it completely blocks the main loop and everything appears locked up until it finishes. That's compounded when we have to do multiple http requests one for each screen
If we really wanted to hold up the startup until all data is ready we should use a semaphore
I would prefer the startup to not be blocked, but to load all data in a background thread.
Especially if we add more widgets, the time-to-fully-load-all-widgets will go up, but IMO it's better if the user can at least see the clock while the data is still loading.
I'm re-writing the startup to use the task manager, so as not to block the Orb
Also, building in the new timer function for the draw frequency
PR #305 created to cover these points