refactor(core): flatten DTO hierarchy to align with flat backend API#52
refactor(core): flatten DTO hierarchy to align with flat backend API#52syed-tp wants to merge 2 commits intoref/dio-singletonfrom
Conversation
syed-tp
commented
Mar 31, 2026
- The nested DTO structure created an architectural "trap" by implying hierarchical data where none exists at the source. Since the backend API and local database are strictly flat, keeping nested collections (chapters/lessons) led to inconsistent state and potential null pointer bugs if the nesting wasn't manually populated.
- This refactor enforces the Single Source of Truth by requiring independent, ID-based fetching through repository streams, which results in more predictable data flow across the UI.
…ions and updating associated providers
There was a problem hiding this comment.
Code Review
This pull request implements DTO hierarchy flattening by removing nested collections from CourseDto and ChapterDto, aligning the models with the flat backend API and local database. The changes include updating serialization logic, refactoring Riverpod providers to fetch related data independently, and adjusting UI screens to handle separate data streams. Feedback identifies an N+1 network request bottleneck in lesson fetching, non-reactive provider implementations using one-time stream reads, and potential UI flickering during loading states.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e57026c9dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…er for real-time updates