fix(namespace): omitted namespace resolves to the connection namespace, never a hardcoded USER (fixes #96) - #101
Open
PYDuquesnoy wants to merge 1 commit into
Conversation
…e, never a hardcoded USER (fixes intersystems-community#96) Omitting the optional per-call namespace ran the call in USER regardless of the server's configured IRIS_NAMESPACE — silently, with plausible results from the wrong database. Root cause: a serde default `default_namespace() -> "USER"` duplicated across six files on ~25 param structs, applied before any connection logic could weigh in; the pool member's namespace (072) was overridden the same way. - namespace params become Option<String>; the six default_namespace fns are deleted. The type change let the compiler enumerate every use site. - one shared resolve_namespace(param, connection_ns) in tools/mod.rs (observability.rs reuses it): explicit non-empty param wins, else the namespace of the connection THE CALL ACTUALLY USES — for server-routed calls that is the pool member's configured namespace, not the default connection's. - responses that echo namespace now echo the resolved value; tool descriptions updated ("defaults to the connection namespace"). - tests pin the new contract: omitted => None + resolves to the connection namespace, explicit => Some(...). Verified: cargo test --workspace 3866 passed / 0 failed; live stdio probe with IRIS_NAMESPACE=APP: iris_execute WRITE $NAMESPACE with no namespace arg -> "APP" (v1.0.0: "USER"), iris_query echoes namespace:"APP". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #96 — with the server configured for
IRIS_NAMESPACE=<ns>, any call omitting the per-callnamespaceran in USER: silently, with plausible results from the wrong database. The serde defaultdefault_namespace() → "USER"sat on ~25 param structs across six files and outranked both the connection config and the 072 pool member's namespace.What
namespaceparams becomeOption<String>; the sixdefault_namespacefns are deleted — the type change let the compiler enumerate every use site, which is how all ~25 structs were found.resolve_namespace(param, connection_ns)(intools/mod.rs;observability.rsnow reuses it instead of its private copy): explicit non-empty param wins → else the namespace of the connection the call actually uses — forserver-routed calls that's the pool member's configured namespace.namespacenow echo the resolved value; tool descriptions updated.None+ resolution to connection ns; explicit ⇒Some).Verification
cargo test --workspace: 3866 passed / 0 failed. Live stdio probe withIRIS_NAMESPACE=APPagainst IRIS 2026.1:namespacearg)iris_executeWRITE $NAMESPACEUSERAPPiris_querySELECT 1"namespace":"APP"echoed(From the intersystems-ib interop fork team — the same fix shipped there as intersystems-ib/iris-interop-dev#16 after 3/3 graded agent sessions reproduced the silent wrong-namespace behavior. Companion to #100; from the same audit as #92/#97–#99.)
🤖 Generated with Claude Code