feat: adding CCX support to edx notes#38665
Conversation
|
Thanks for the pull request, @luisfelipec95! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
ormsbee
left a comment
There was a problem hiding this comment.
I think the approach of removing version info from the key makes total sense. Please also write a test to ensure this behavior. Thank you!
| # Use camelCase to name keys. | ||
| "usageId": self.scope_ids.usage_id, | ||
| "courseId": course.id, | ||
| "courseId": course.id if not is_ccx_course(course.id) else course.id.for_branch(branch=None), |
There was a problem hiding this comment.
Can't we always do course.id.for_branch(branch=None) regardless of what kind of course it is? If so, please do that, and put a comment above explaining why.
Also, please make this a "fix:" not a "feature:". I realize the net effect allows people to use notes in CCX courses, which is great, but it was always intended to work in courses.
Description
This PR addresses an issue where notes created within a CCX are not displayed in the Notes tab.
The root cause is a mismatch in the course_id used when saving versus retrieving notes:
This inconsistency causes the Notes tab to return no results for CCX notes, even though they were successfully saved.
Proposed Solution
This PR standardizes the course_id used when persisting notes to ensure consistency between write and read operations.
For CCX courses, the course_id may include branch and version information, which is not consistently used across consumers such as the Notes tab. This change normalizes the identifier for CCX contexts before saving, ensuring that stored notes can be reliably retrieved.
This approach aligns how course_id is handled across services while preserving existing behavior for non-CCX courses.