Skip to content

fix(shell): prevent crash when target namespace lacks IPM mappings - #994

Merged
isc-dchui merged 19 commits into
intersystems:mainfrom
AshokThangavel:fix/zn-command-ipm-missing
Aug 21, 2026
Merged

fix(shell): prevent crash when target namespace lacks IPM mappings#994
isc-dchui merged 19 commits into
intersystems:mainfrom
AshokThangavel:fix/zn-command-ipm-missing

Conversation

@AshokThangavel

Copy link
Copy Markdown
Contributor

This PR resolves a terminal crash occurring within the zn (namespace) command utility. The error was triggered when the utility attempted to list or switch to namespaces where the IPM/ZPM package classes were not mapped or enabled.

The crash happened specifically because the zn tool's display logic attempted to pull UI configuration

Related Issues

Changes

  • Namespace-Aware Checks: Implemented a safety check (IsIPMEnabled) to verify if IPM classes are available in a target namespace before attempting to access them.
  • Informative Listing: Enhanced the zn * and zn [pattern] output to explicitly mark namespaces that do not have IPM enabled with a (IPM not enabled) label. This improves the user experience by clarifying why certain IPM features might be unavailable after switching.

Testing Conducted

  • Listing: Ran zn * and verified that namespaces like %SYS and USER are listed with the (IPM not enabled) suffix without throwing an error.
  • Switching: Executed zn %SYS from the IPM shell. Verified that the switch completes and the prompt handles the missing class context correctly.
  • Wildcard Filtering: Verified that pattern matching (e.g., zn %S*) still works and filters the list as expected without crashing.

@isc-kiyer isc-kiyer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@AshokThangavel few small comments but fix looks good!

Comment thread src/cls/IPM/Main.cls Outdated
Comment thread src/cls/IPM/Main.cls Outdated
Comment thread src/cls/IPM/Main.cls Outdated
Comment thread src/cls/IPM/Main.cls Outdated
@isc-dchui
isc-dchui requested a review from isc-kiyer August 20, 2026 18:58
@isc-dchui
isc-dchui merged commit 92758af into intersystems:main Aug 21, 2026
12 checks passed
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.

<CLASS DOES NOT EXIST> error in zn command when IPM is not enabled in target namespace

3 participants