Skip to content

Fix intermittent schedule load failure#242

Open
JacobCoffee wants to merge 1 commit intomainfrom
fix/schedule-load-race
Open

Fix intermittent schedule load failure#242
JacobCoffee wants to merge 1 commit intomainfrom
fix/schedule-load-race

Conversation

@JacobCoffee
Copy link
Copy Markdown
Member

Summary

Fixes two compounding bugs that caused the schedule to intermittently show "Schedule not loaded" despite working network:

  1. Race condition in load() — concurrent calls each created separate HTTP requests. Now uses shareReplay() so all subscribers share one execution. Removed dangerous this.data = null reset mid-flight.

  2. hasData never set in updateSchedule() — the "not loaded" error was controlled by hasData which was only set in reloadSchedule(). If that initial path failed, subsequent successful loads via updateSchedule() (tab show, filter, search) still showed the error. Now sets hasData = true in the timeline callback.

Test plan

  • Cold start the app — schedule should load without "not loaded" error
  • Navigate away and back to schedule tab — should not show error
  • Kill app and reopen — should load from cache then refresh
  • Turn off network, open app — should show cached schedule or proper error

🤖 Generated with Claude Code

Two bugs fixed:

1. conference-data.ts: Concurrent calls to load() each created separate
   HTTP requests. Added shareReplay() and loadObservable caching so all
   concurrent subscribers share one execution. Removed the dangerous
   this.data = null reset before processData(). Cleared in-flight
   observable on complete/error for proper retry on failure.

2. schedule.ts: hasData was only set in reloadSchedule() but
   updateSchedule() (called on every tab show, filter, search) never
   set it. Added hasData = true in updateSchedule()'s getTimeline
   callback so the "not loaded" error clears even if the initial
   reloadSchedule() path failed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JacobCoffee
Copy link
Copy Markdown
Member Author

needs review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant