Skip to content

fix: make getAppConfig always return an object - #342

Merged
arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:arbrandes/get-app-config-always-object
Nov 2, 2026
Merged

arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:arbrandes/get-app-config-always-object

Conversation

@arbrandes

Copy link
Copy Markdown
Contributor

Description

getAppConfig returned undefined for an app with no defaultConfig, no config, and no site-wide commonAppConfig, despite its declared AppConfig return type. The early return was a leftover from before the three-source merge existed and nothing depends on it, so this drops it: the merge now always yields an object, {} at minimum. The ?? {} guard in the external scripts loader is removed as dead code, and tests cover the no-config and unknown-app cases for both getAppConfig and useAppConfig.

Resolves #337

LLM usage notice

Built with assistance from Claude.

An app with no defaultConfig, no config, and no site-wide commonAppConfig
got undefined from getAppConfig, despite its declared AppConfig return
type. Drop the early return so the merge always yields an object, and
remove the caller-side guard that worked around it.

Resolves openedx#337

Co-Authored-By: Claude <noreply@anthropic.com>

@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.

:shipit:

@arbrandes
arbrandes merged commit f843424 into openedx:main Nov 2, 2026
5 checks passed
@openedx-semantic-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0-alpha.18 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getAppConfig returns undefined for an app with no defaultConfig, commonAppConfig or config

3 participants