Skip to content

feat: riverpod migration - #1843

Merged
Nirajn2311 merged 53 commits into
mainfrom
feat/riverpod-migration
Oct 23, 2026
Merged

Nirajn2311 merged 53 commits into
mainfrom
feat/riverpod-migration

Conversation

@Nirajn2311

@Nirajn2311 Nirajn2311 commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

This PR rewrites the whole app to make use of Riverpod 3 (with codegen) + Go Router along with cleaning up dead code and simplifying the flows. The layer map file will explain the various layers the app is structured against and should be strictly followed. A couple of bug fixes have also been done along with QOL improvements.

List of bug fixes/QOL improvements/removals done compared to v7:

  • Remote config and session restore fetch happens behind the splash with a 10s timeout
  • Crashlytics only runs in release builds. Uncaught async errors are logged as non-fatal and Remote Config failures are logged as non-fatal with a reason
  • Notifications start lazily on first use instead of before runApp, so fewer things can black-screen startup
  • A 401 on any authenticated call signs the user out everywhere
  • SQLite and any package related to it
  • Quick actions - will be readded later properly
  • Every screen error has a Retry button (ErrorRetry), including offline Code Radio, podcasts, news and auth
  • Learn offline support and localisation changes have been removed as they were never implemented nor used
  • .env keys renamed - DEVELOPMENTMODE -> DEVELOPMENT_MODE, SHOWALLSB -> SHOW_ALL_SB
  • News
    • Feed and detail now use separate GraphQL fragments (PostSummary vs Post). A feed page dropped from 742KB to 32.5KB (23x smaller requests)
    • The SQLite -> JSON migrator is dropped as 98% of our users are on v7.5.x and so majority of the users are using the JSON stores. The SQLite -> JSON migration update happened around 8-9 months ago in v7.1.0
  • Code Radio
    • The code radio stream no longer reconnects on every song change. This fixes v7's audible gap every 2–4 minutes and the song changes now only update the notification metadata
    • Resuming after a pause jumps back to the live stream. Before, it could play up to minutes of stale buffered audio.
    • Fixed v7 showing the next song's artist as the current one
    • The notification keeps updating after leaving the screen
  • Podcasts
    • Deleting an episode now removes the mp3. v7 deleted from the wrong directory. A one-time startup sweep cleans up files leaked by v7
    • Fixed switching episodes saving the new episode's resume position onto the old one
    • Multiple downloads can run at once, keyed by episode. Failures show a retry button
  • Learn
    • Challenge types that don't use the editor (quiz, Python project, lesson, English) now show the assignments that v7 never displayed
    • When the test runner fails or doesn't start, you see an error message and a retry button
    • Fixed v7 sending the daily notification twice
    • The curriculum e2e runner now deletes the copied curriculum.json (v7 bundled ~120MB) and reads its results from report data, because device stdout cuts off the end of the run
Path routes of the various views(expand to view)

├─/learn (Widget)
├─/learn/daily-challenges (Widget)
├─/learn/daily-challenges/:day (Widget)
├─/learn/scene-fullscreen (Widget)
├─/learn/:superBlock (Widget)
├─/learn/:superBlock/:module (Widget)
├─/learn/:superBlock/:block/:challengeId (Widget)
├─ (ShellRoute)
│ ├─/news/bookmarks (Widget)
│ ├─/news (Widget)
│ └─/news/search (Widget)
├─/news/image (Widget)
├─/news/tag/:tagSlug (Widget)
├─/news/author/:username (Widget)
├─/news/bookmarks/:id (Widget)
├─/news/:slug (Widget)
├─/code-radio (Widget)
├─ (ShellRoute)
│ ├─/podcasts (Widget)
│ └─/podcasts/downloads (Widget)
├─/podcasts/:podcastId (Widget)
├─/podcasts/:podcastId/:episodeId (Widget)
├─/login (Widget)
├─/profile (Widget)
├─/settings (Widget)
└─/settings/delete-account (Widget)

@Nirajn2311
Nirajn2311 requested a review from a team as a code owner September 23, 2026 05:06
huyenltnguyen

This comment was marked as resolved.

@Nirajn2311

Nirajn2311 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

Finding 1 (P1): Import SQLite data before treating missing JSON as an empty library

Check PR description

Finding 2 (P2): Keep download dependencies alive until transfers and persistence finish

Wasn't able to reproduce this and both episodes got shown as downloaded. To be on the safer side I've made the repo be kept alive so only a single instance is active

Finding 3 (P2): Ignore superseded audio loads instead of stopping or relabeling the current source

Fixed

Finding 4 (P2): Do not save the previous episode's position against the next episode

Fixed

Finding 5 (P2): Reinitialize Code Radio after notification Stop

Fixed

Finding 6 (P2): Bind episode controls to the episode displayed on the page

Fixed

Finding 7 (P2): Honor cancellation during the remainder of the download operation

Fixed

Finding 8 (P2): Avoid leaving repeated searches in a loading state

Fixed

Finding 9 (P2): Reject pagination results after disposal or refresh

Fixed

I've pulled the changes down to test. Everything seems to be working as expected, though I'm wondering if this might just be an issue on my end. I'm using 16e in the simulator, and the text in both News and Podcast seems a bit large: there are only about 5-6 words per line.

This is same in v7. We'll standardise the text size across the whole app in the UI redesign PR.

There should be a sample.env file so we can compare the variables with those in our .env (DEVELOPMENTMODE and SHOWALLSB had changed and it took me a while to figure out what was wrong)

Ahh yea my bad. I've directly updated v7 sample.env in prep of the final move

Sidebar text is no longer in upper case

I changed it to sentence case, if we want to keep upper case we can do so. Either ways the UI redesign removes the drawer completely

On daily challenge, the Check button briefly displays a spinner when switching languages

That's the test runner getting ready for the new language by loading the scripts in. Clicking the button won't run the checks or do anything.

When a request gets a 401, the app signs the user out but never tells them their session expired. On the challenge screens, where submit makes that request, every screen shows the same connection error from CompleteButton.

Yes the 401 catch to sign out was done to prevent the various "progress not tracked" issues and handle the case of expired tokens. Do we add in the changes to inform user of the behavior here or include that in the UI redesign?

huyenltnguyen
huyenltnguyen previously approved these changes Oct 21, 2026

@huyenltnguyen huyenltnguyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed internally and we'll address the 401 status issue in a separate PR.

Sembauke
Sembauke previously approved these changes Oct 21, 2026
@Sembauke

Copy link
Copy Markdown
Member

one more thing I want to check before I merge tomorrow.

@Nirajn2311

Copy link
Copy Markdown
Member Author

one more thing I want to check before I merge tomorrow.

DONT MERGE

These changes will be copied back into mobile-app before merging

@Nirajn2311
Nirajn2311 dismissed stale reviews from Sembauke and huyenltnguyen via 0dae06b October 22, 2026 19:02
…tion

# Conflicts:
#	mobile-app/lib/l10n/app_en.arb
#	mobile-app/lib/l10n/app_es.arb
#	mobile-app/lib/l10n/app_localizations.dart
#	mobile-app/lib/l10n/app_localizations_en.dart
#	mobile-app/lib/l10n/app_localizations_es.dart
#	mobile-app/lib/l10n/app_localizations_pt.dart
#	mobile-app/lib/l10n/app_pt.arb
@Nirajn2311
Nirajn2311 merged commit 74c99fb into main Oct 23, 2026
6 checks passed
@Nirajn2311
Nirajn2311 deleted the feat/riverpod-migration branch October 23, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants