You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(module): fix configurator phase ordering and dot-path optional branches
Two independent fixes needed by the framework mock work:
- Module re-registration now replaces the prior module's configure,
afterConfig, and afterInit callbacks instead of appending to them,
keyed by module name (_dedupeModulesByName /
_removeModuleCallbacks). This prevents stale callback execution
when a mock module (e.g. enableMsalMock) overrides a real module
registration, and fixes configurator phases running out of order
or skipping post-configure hooks in certain initialization paths.
- DotPath now unwraps an optional object property with NonNullable
the same way DotPathType already did, so a path BaseConfigBuilder
understands is one _set no longer refuses. Given
{ foo?: { bar: string } }, 'foo.bar' is now a valid path, matching
'foo' which was already allowed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix `DotPath` skipping over optional object properties, which made anything beneath them unreachable from `BaseConfigBuilder._set`.
6
+
7
+
An optional property is typed `T | undefined`, which does not extend `object`, so the path union stopped at the property itself: given `{ foo?: { bar: string } }`, `'foo'` was allowed but `'foo.bar'` was not. `DotPathType` already unwrapped such properties with `NonNullable`, so the two disagreed — a path it could resolve was one `_set` refused.
8
+
9
+
`DotPath` now unwraps the same way. This only widens the accepted union, so existing calls are unaffected.
Ensure module re-registration replaces prior `configure`, `afterConfig`, and `afterInit` callbacks for modules with the same name. This prevents stale callback execution when mock modules like `enableMsalMock` override a real module registration.
Fix a bug in the module configurator that caused configurator phases (configure / post-initialize / dispose) to run out of order or skip post-configure hooks in certain initialization paths.
6
+
7
+
This ensures module configuration and plugin hooks run reliably during module initialization, preventing missed setup steps for consumer modules.
8
+
9
+
Fixes: restores correct configurator phase ordering and prevents lost initialization for modules that rely on post-configure hooks.
0 commit comments