Skip to content

APPS-3849 Fix stale course price on detail screen#995

Open
XanderZhu wants to merge 1 commit into
developmentfrom
fix/APPS-3849
Open

APPS-3849 Fix stale course price on detail screen#995
XanderZhu wants to merge 1 commit into
developmentfrom
fix/APPS-3849

Conversation

@XanderZhu

Copy link
Copy Markdown
Contributor

Issue

https://youtrack.stepik.net/issue/APPS-3849/Ne-obnovlyaetsya-stoimost-v-prilozhenii

What changed

  • Course detail screen now follows the same cache -> remote refresh pattern as course lists.
  • On regular course opening, the header is rendered from local cache first and then refreshed from remote.
  • Fresh remote Course data is saved through the existing repository path and updates the visible header.
  • If remote refresh fails after cached data was shown, the screen keeps the cached course instead of switching to the network error state.
  • One-time side effects on course open are guarded from running twice when cache and remote emissions both arrive.

Why

The stale price reports can happen when a cached Course contains an old display_price from a past promo. Before this change, course detail used CACHE with fallback and did not request remote data if the course already existed locally, so the stale price could remain visible until another screen or pull-to-refresh updated the DB.

Verification

  • ./gradlew :app:compileDebugKotlin
  • ./gradlew :app:assembleDebug
  • Manual AVD check on emulator-5554: patched course 82541 local DB to stale display_price=3900 ₽ and opened https://stepik.org/course/82541/promo; detail screen refreshed to backend price/promo without pull-to-refresh.
  • Manual AVD check with temporary local remote-error simulation: cached course stayed visible after remote failure; with no cache and remote failure the screen showed the network error state. The temporary simulation code was removed before commit.

@XanderZhu XanderZhu self-assigned this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant