Skip to content

Revert "fix: narrow FieldDataCache prefetch to a learner's saved question picks" - #441

Open
santhosh-apphelix-2u wants to merge 1 commit into
release-ulmofrom
revert-440-lp-284-narrow-field-data-cache-prefetch
Open

Revert "fix: narrow FieldDataCache prefetch to a learner's saved question picks"#441
santhosh-apphelix-2u wants to merge 1 commit into
release-ulmofrom
revert-440-lp-284-narrow-field-data-cache-prefetch

Conversation

@santhosh-apphelix-2u

Copy link
Copy Markdown

Reverts #440

Copilot AI lite review requested due to automatic review settings August 26, 2026 05:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 using block.get_children() instead of a special-case narrowing path for dynamic-children blocks.
  • Remove helper methods that queried StudentModule to infer persisted selections (and drop the now-unused InvalidKeyError import).
  • Remove the TestFieldDataCacheDynamicChildren test 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():
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.

5 participants