fix(SF2.0): Properly show loading circle when changing schedules#3066
Merged
fix(SF2.0): Properly show loading circle when changing schedules#3066
Conversation
lvachon1
approved these changes
Mar 31, 2026
Contributor
lvachon1
left a comment
There was a problem hiding this comment.
This is very good to know, thanks for showing us this smarter pattern!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Asana Ticket: 📅🔎 Fix performance of Daily Schedule schedule-change
Implementation
After investigating, there are two potential causes for loading circle taking a while to appear:
1 would require a more involved change in how we do state management and is unlikely to be encountered, so I've not included a change in the behavior here.
The root of the issue as seen in QA is likely 2, since the folks who helped with QA shouldn't be encountering such high latency between a client and server. The fix is a fairly straightforward separation of the assignment into two parts, one for the async request for the schedule and one to set the loading status while the async request is performed.
Screenshots
No static visual change, observe change in when loading circle loads in
How to test
Copley on dev-green (or can check in prod) should have the undesirable behavior (loading circle/schedule change takes a while to appear after changing the schedule)
Copley on dev-blue should display the fixed behavior (loading circle should appear immediately after changing the schedule)
If the above does not make it clear, it's possible to exaggerate the issue locally to make it more obvious:
We can check that waiting for the assign is an issue by introducing a lengthy sleep in
/Users/ltan/Documents/code/dotcom/lib/dotcom_web/live/schedule_finder_live.ex assign_service/2(e.g.:timer.sleep(5000)) on the main branch and using the Daily Schedule selector (link to Copley for convenience) . Observe the 5 second delay (or however long you set) between selection, and the loading circle briefly flashing before quickly changing to the correct schedule.You can verify the fix locally by putting the sleep in the same place on this branch. When using the selector, the loading circle should appear near immediately and stay for the duration of the sleep, then change to the schedule.