Refactor Practice Test Studyset Mappings to Join Table#24
Conversation
- Add practice_test_studysets join table via migration. - Materialize studyset involvement in RecordPracticeTest and UpdatePracticeTest. - Enforce access control for studysets during practice test recording. - Optimize getPracticeTestsByStudysetIDs loader using the new join table. - Update StudysetIds resolver to query the materialized relationship.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
The test was incorrectly asserting that a user could record a practice test for terms in a private studyset they don't own. I updated the test to expect an error, matching the implemented behavior and my latest instructions.
Refactored the relationship between practice tests and studysets from a computed-at-query-time approach to a materialized many-to-many relationship using a new
practice_test_studysetsjoin table. This change improves query performance by removing expensive joins andDISTINCT ONlogic in dataloaders. The mutationsRecordPracticeTestandUpdatePracticeTestnow collect and verify accessible studysets at creation/update time and record them in the join table. Access control was also re-introduced to ensure users can only record tests for studysets they have access to.PR created automatically by Jules for task 4776371520077265337 started by @ehanahamed