5Zone widget and Async HTTP requests #304

Open
opened 2025-03-18 23:51:03 +00:00 by dreed47 · 8 comments
dreed47 commented 2025-03-18 23:51:03 +00:00 (Migrated from github.com)

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.

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.
HugoBalder commented 2025-03-19 00:01:36 +00:00 (Migrated from github.com)

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.

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.
brett-dot-tech commented 2025-03-19 04:31:06 +00:00 (Migrated from github.com)

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.

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.
nconner-06 commented 2025-03-19 07:08:47 +00:00 (Migrated from github.com)

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?

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?
dreed47 commented 2025-03-19 09:51:14 +00:00 (Migrated from github.com)

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

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
dreed47 commented 2025-03-19 09:57:16 +00:00 (Migrated from github.com)

If we really wanted to hold up the startup until all data is ready we should use a semaphore

If we really wanted to hold up the startup until all data is ready we should use a semaphore
flattermann commented 2025-03-19 13:25:27 +00:00 (Migrated from github.com)

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 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.
nconner-06 commented 2025-03-19 14:32:36 +00:00 (Migrated from github.com)

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

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
nconner-06 commented 2025-03-20 13:53:08 +00:00 (Migrated from github.com)

PR #305 created to cover these points

PR #305 created to cover these points
Sign in to join this conversation.
No description provided.