Skip to content

Sync practice tests and question structures with backend API - #7

Merged
ehanahamed merged 1 commit into
mainfrom
sync-backend-practice-tests-14544066344165874618
Jun 27, 2026
Merged

Sync practice tests and question structures with backend API#7
ehanahamed merged 1 commit into
mainfrom
sync-backend-practice-tests-14544066344165874618

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

This PR updates the idb-api-layer to match recent changes in the backend GraphQL API.

Key changes include:

  1. Many-to-Many Mappings: Practice tests are now mapped to multiple studysets and terms using multi-entry indexes (studysetIds and termIds). This allows for efficient reverse lookups.
  2. Data Snapshots (TermAtp): Questions now use a slim TermAtp structure instead of full Term objects. This stores the term and definition text at the time the test was taken, preserving historical accuracy even if terms are edited later.
  3. API Consistency: recordPracticeTest and updatePracticeTest now automatically calculate questionsCorrect and questionsTotal from the provided questions, simplifying the API and aligning it with the backend.
  4. Data Migration: Added a Dexie upgrade migration to version 16 that automatically transforms existing local data to the new format, ensuring a smooth transition for users.
  5. New Functionality: Added updatePracticeTest and getPracticeTestsByTermId.

Verified with full test suite passing.


PR created automatically by Jules for task 14544066344165874618 started by @ehanahamed

- Update database schema to use multi-entry indexes for `studysetIds` and `termIds` in the `practiceTests` table.
- Implement Dexie migration (version 16) to transform existing practice test data.
- Adopt `TermAtp` structure within questions to store snapshots of terms (id, term, def).
- Update `recordPracticeTest` to automatically calculate results and populate mapping IDs.
- Implement `updatePracticeTest` and `getPracticeTestsByTermId`.
- Update tests to match new API signatures and data structures.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@ehanahamed
ehanahamed merged commit cc58bbd into main Jun 27, 2026
1 check failed
@ehanahamed
ehanahamed deleted the sync-backend-practice-tests-14544066344165874618 branch June 29, 2026 21:34
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.

Add same practice tests to terms mapping from backend API to idb-api-layer

1 participant