-
Notifications
You must be signed in to change notification settings - Fork 122
fix: load sequences in unit page #1867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: load sequences in unit page #1867
Conversation
Thanks for the pull request, @ihor-romaniuk! 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. Where 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. |
Thanks for the pull request, @ihor-romaniuk! 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. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where 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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1867 +/- ##
==========================================
+ Coverage 93.98% 93.99% +0.01%
==========================================
Files 1155 1155
Lines 24146 24123 -23
Branches 5116 5117 +1
==========================================
- Hits 22693 22675 -18
+ Misses 1385 1380 -5
Partials 68 68 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d83432e
to
a6892c0
Compare
a6892c0
to
ad1b589
Compare
ad1b589
to
a079913
Compare
I think you are missing the root cause here. When I open a unit page directly and then log in, without accessing other Authoring MFE pages first, I see this in the network logs:
The second request fails because the So really, I think we need to fix this properly - either:
It seems like there's also duplicate requests being made to each of these endpoints, so in the long term we really should be using React Query to load the data since it will de-duplicate the requests better. However, if you don't have time to fix this "properly" now, I'm fine with merging the fix you've made here - it is reasonable. But my big concern is that we're just going to get more errors like this until we fix the root cause, especially in code that's not using TypeScript so nobody has any idea if fields like |
@@ -12,15 +12,15 @@ export function useSequenceNavigationMetadata(courseId, currentSequenceId, curre | |||
const isLastUnit = !nextUrl; | |||
const sequenceIds = useSelector(getSequenceIds); | |||
const sequenceIndex = sequenceIds.indexOf(currentSequenceId); | |||
const unitIndex = sequence.unitIds.indexOf(currentUnitId); | |||
const unitIndex = sequence.unitIds?.indexOf(currentUnitId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navinkarkera @rpenido @pomegranited FYI on this PR/error. |
What @bradenmacdonald said:
What I suggest is for a new issue to be created with the relevant info, and for us to merge this one as a workaround for Teak in the meantime. |
3629deb
to
ea6e13b
Compare
@arbrandes @bradenmacdonald Thanks for your feedback. I have replaced the old |
Sandbox deployment successful 🚀 |
@ihor-romaniuk, I still see the error (or an error) when I go to the unit page directly while logged out, then immediately log in: This is in this PR's sandbox, btw. |
7a3b305
to
ce05909
Compare
e34311a
to
08f5a95
Compare
Sandbox deployment successful 🚀 |
08f5a95
to
238faeb
Compare
Sandbox deployment successful 🚀 |
@arbrandes I’ve finally resolved the issue with the instance. The problem was caused by deploying from the wrong repository. We were deploying from the RG space frontend-app-course-authoring, but no changes were visible because the MFE ID was set to course-authoring instead of authoring. I added a custom configuration to the sandbox settings, and everything is now working as expected:
Please take a look when you get a chance. |
238faeb
to
598cbf6
Compare
Sandbox deployment successful 🚀 |
Sandbox deployment failed 💥 |
Sandbox deployment successful 🚀 |
a98f89e
to
7745430
Compare
Sandbox deployment successful 🚀 |
This is looking ready for CC review now -- @navinkarkera or @ChrisChV can you review? I'm not CC on this repo :) |
Hi @ihor-romaniuk , could you add a bit of test coverage to fix the code coverage? |
@arbrandes Would you be able to take another look at this soon? I think it's a pretty high priority bugfix. Or do you need someone else to take on the review? And yes, @ihor-romaniuk , we'll need the codecov check passing to be able to merge this. |
73cc156
to
c5cda97
Compare
Sandbox deployment successful 🚀 |
@pomegranited @bradenmacdonald @arbrandes Test coverage was updated and it's ready for review. |
Sandbox deployment successful 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! It's looking good and it fixes the bugs that I have seen. Since it's such a big refactor I'm not sure if we should backport it to Teak though. Perhaps just the
part, or some smaller bit like that is what we backport?
Edit: that's done - #2042
const courseSectionVerticalData = normalizeCourseSectionVerticalData(data); | ||
courseSectionVerticalData.xblockInfo.readOnly = isUnitReadOnly(courseSectionVerticalData.xblockInfo); | ||
|
||
return courseSectionVerticalData; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function getCourseSectionVerticalData
has a confusing name. The docstring just says "Get an object containing course section vertical data" but even as an expert on Open edX I wouldn't really know what "course section vertical data" is. How is that different from just "vertical data"? I think it's not.
Since we're using this function a lot more now, could we rename it to getVerticalData
or getContainerData
? That's way more clear, and matches what it's actually doing - it calls the container_handler
endpoint which says "View for container xblock requests to get vertical data."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ihor-romaniuk What do you think about renaming this before we merge?
@arbrandes would you be able to take a quick look here too before we merge, or no? |
Description
Handle loading errors when opening the course unit page via direct link as an unauthorized user.
Backport:
Screenshots
Case 1: Open course unit page

Case 2: Open Split Test xblock content

Testing instructions
-- Verify that the course unit page loads correctly after authentication.
-- Add Split Test xBlock
-- Open Split Test xBlock content page
-- Verify that the Split Test xBlock content page loads correctly.
Other information
Settings