Skip to content

Conversation

@NiloCK
Copy link
Collaborator

@NiloCK NiloCK commented Aug 8, 2025

Up to the mood of the backend, studySessions were sometimes laggy because card lookups require 2 db trips (card info, then data hydration).

This PR moves some db logic from common-ui/StudySession.vue to db/SessionController.ts (better location) and improves it w/ a running cache of ~5 cards worth of hydrated data.

  • prep work on card data caching
  • migrate nextCard selection to SessionController...
  • use hydrated card stack for nextQ
  • pass filterFcns, await initial hydration lookup
  • rm working docs on caching card data

@NiloCK NiloCK changed the title studysession cache perf: studysession caching of anticipated card data Aug 8, 2025
NiloCK added 7 commits August 8, 2025 14:59
prevent null returns if db-work is ongoing
instead of waiting for entire buffer to hydrate
now async after making the hydrationQ more robust against timing issues
prevents circular dependency between db and common-ui packages
and use a generic decorator to pass type safety of ViewComponents
@NiloCK NiloCK merged commit 6a7e565 into master Aug 8, 2025
7 checks passed
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.

2 participants