Skip to content

fix: Fix data API URL handling - #706

Merged
arbrandes merged 1 commit into
openedx:masterfrom
arbrandes:fix-generic-data-api
Nov 21, 2023
Merged

fix: Fix data API URL handling#706
arbrandes merged 1 commit into
openedx:masterfrom
arbrandes:fix-generic-data-api

Conversation

@arbrandes

Copy link
Copy Markdown
Contributor

Description

All configuration calls must handled asynchronously, otherwise they risk failure in runtime configuration scenarios.

To reproduce

The failure is readily reproducible in tutor local nightly or quince deployments. Simply navigate to a course's "Pages and Resources" page in Studio. The MFE will fail with a Uncaught TypeError: URL constructor: course/ is not a valid URL. at src/generic/data/api.js on line 7.

The fix

The fix is to make any and all such config assignments into function calls, so that they're resolved just-in-time, as opposed to at initial load time.

All configuration calls must handled asynchronously, otherwise they risk
failure in runtime configuration scenarios.
@codecov

codecov Bot commented Nov 21, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (02cdccc) 88.62% compared to head (9318717) 88.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #706   +/-   ##
=======================================
  Coverage   88.62%   88.62%           
=======================================
  Files         446      446           
  Lines        6851     6851           
  Branches     1465     1465           
=======================================
  Hits         6072     6072           
  Misses        754      754           
  Partials       25       25           

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

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@arbrandes

Copy link
Copy Markdown
Contributor Author

Thanks, @brian-smith-tcril!

@arbrandes
arbrandes merged commit a622f8e into openedx:master Nov 21, 2023
@arbrandes
arbrandes deleted the fix-generic-data-api branch November 21, 2023 19:57
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.

2 participants