Skip to content

fix: update advanced module list not working #2189

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

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

Faraz32123
Copy link
Contributor

@Faraz32123 Faraz32123 commented Jun 18, 2025

Ticket: TNL-12010
Backend was expecting {'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}
but after this PR merged, it was receiving {'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}

It's better to send snake case settings from frontend instead of changing/fixing the function at backend here.
If we change line 262 from val = model['value'] to val = model, it will still fail on next line if hasattr(block, key) and getattr(block, key) != val: as hasattr(block, 'advancedModules') is incorrect. It needs advancedModules as key.

Before:
Screenshot 2025-06-18 at 6 20 36 PM

After:
Screenshot 2025-06-18 at 6 22 10 PM

Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}`
@Faraz32123 Faraz32123 self-assigned this Jun 18, 2025
@Faraz32123 Faraz32123 requested review from rayzhou-bit and a team June 18, 2025 13:26
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@19f81cc). Learn more about missing BASE report.
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #2189   +/-   ##
=========================================
  Coverage          ?   94.08%           
=========================================
  Files             ?     1164           
  Lines             ?    24481           
  Branches          ?     5305           
=========================================
  Hits              ?    23033           
  Misses            ?     1380           
  Partials          ?       68           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bradenmacdonald
Copy link
Contributor

@jignaciopm @arbrandes can you please take a look? Why is this so complicated :p

Copy link
Contributor

@rayzhou-bit rayzhou-bit left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Contributor

@jignaciopm jignaciopm left a comment

Choose a reason for hiding this comment

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

@bradenmacdonald It was wrong to remove that in PR#1581... This change is correct. When this PR is merged, I'll apply the backport in my PR #2087

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

OK then good with me. But... shouldn't we have some test that catches this error? I think the test is mocked at too high of level, so it didn't catch this. The test should only mock the raw HTTP response coming from the API and then assert on the raw API response send back to the server after the settings are edited, and that would ensure bugs like this don't happen.

@bradenmacdonald bradenmacdonald merged commit b510b6f into master Jun 18, 2025
7 checks passed
@bradenmacdonald bradenmacdonald deleted the fix/update_advanced_module_list branch June 18, 2025 20:33
jignaciopm pushed a commit to eduNEXT/frontend-app-course-authoring that referenced this pull request Jun 19, 2025
Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}`

Follow up to openedx#1581

Co-authored-by: Muhammad Faraz  Maqsood <[email protected]>
bradenmacdonald pushed a commit that referenced this pull request Jun 19, 2025
…rt) (#2087)

* fix: advanced-settings api should not camel-case return value (#1581)

* fix: update advanced module list not working (#2189)

Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}`

Follow up to #1581

---------

Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
luisfelipec95 pushed a commit to eduNEXT/frontend-app-course-authoring that referenced this pull request Jul 4, 2025
…rt) (openedx#2087)

* fix: advanced-settings api should not camel-case return value (openedx#1581)

* fix: update advanced module list not working (openedx#2189)

Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}`

Follow up to openedx#1581

---------

Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
luisfelipec95 pushed a commit to eduNEXT/frontend-app-course-authoring that referenced this pull request Jul 7, 2025
…rt) (openedx#2087)

* fix: advanced-settings api should not camel-case return value (openedx#1581)

* fix: update advanced module list not working (openedx#2189)

Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}`

Follow up to openedx#1581

---------

Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
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.

4 participants