Revert "fix: narrow FieldDataCache prefetch to a learner's saved question picks" - #441
Open
santhosh-apphelix-2u wants to merge 1 commit into
Open
Conversation
rahulkanneri-2u
approved these changes
Aug 26, 2026
Alam-2U
approved these changes
Aug 26, 2026
There was a problem hiding this comment.
Pull request overview
This PR reverts the recently-added behavior that narrowed FieldDataCache descendant prefetch for blocks with dynamic children (e.g., randomized/question-bank blocks), restoring the prior approach that traverses all children returned by get_children() (plus required descriptors). It also removes the unit tests that asserted the narrowed-prefetch behavior.
Changes:
- Revert
FieldDataCache.add_block_descendents()to prefetch usingblock.get_children()instead of a special-case narrowing path for dynamic-children blocks. - Remove helper methods that queried
StudentModuleto infer persisted selections (and drop the now-unusedInvalidKeyErrorimport). - Remove the
TestFieldDataCacheDynamicChildrentest class that validated the narrowed-prefetch behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lms/djangoapps/courseware/tests/test_model_data.py |
Removes tests covering narrowed prefetch behavior for dynamic-children/question-bank blocks. |
lms/djangoapps/courseware/model_data.py |
Restores full child traversal in FieldDataCache and deletes the selection-narrowing logic. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| new_depth = depth - 1 if depth is not None else depth | ||
|
|
||
| for child in self._children_to_prefetch(block): | ||
| for child in block.get_children() + block.get_required_block_descriptors(): |
naincy128
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #440