Skip to content

The pull-to-refresh indicator can stay over «Сегодня»'s header for good once a refresh is cancelled #224

Closed

Description

@lumenpearson

What is broken. On the owner's phone, during a lesson, a dark-purple blob inside a light-purple circle hung at the top of «Сегодня», next to the title. That is the pull-to-refresh ContainedLoadingIndicator, which is drawn only while isRefreshing is true or during a drag.

Cause. TodayViewModel.refresh() sets refreshing = true, awaits timetableRepository.refresh(), and resets the flag only on the normal return path.

  • Anything that escapes the repository leaves the flag true for the life of the ViewModel. In practice that is a CancellationException, which coroutines do not report as a crash.
  • The if (refreshing.value) return guard then refuses every later pull, so the user cannot clear it either.
  • HomeworkViewModel.refresh() and SettingsViewModel.refreshNow(), which drives «Обновить сейчас» (The spinner on «Обновить сейчас» is nearly invisible in both themes #223), have the same shape.

Even on the normal path, the wait can be minutes: a 60 s call timeout, a possible second bundle request, and a wait on a background sync already in flight. With system animations off, a legitimate refresh shows as a frozen blob.

Expected.

  • refreshing is reset in a finally, so a cancelled or failed refresh never leaves the indicator parked.
  • The indicator emerges below the status bar rather than from behind the clock.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions