fix(admin): carry namespaceid on appauth delete events #7962
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 284 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.338
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #7962"
general
weight: 0.35
Aias00
What is the problem
AppAuthServiceImpl#deletebuilt theAppAuthDataof a DELETE event without anamespaceId, and published one event for the whole batch.Data-changed listeners treat a null namespace as
SYS_DEFAULT_NAMESPACE_ID:AbstractNodeDataChangedListener#onAppAuthChangedbuilds the key prefix fromdefault, so the keyns-A.<authDataId>.<appKey>is never deleted.WebsocketDataChangedListenergroups by each item's namespace, so the DELETE message only reaches gateways of the default namespace.Impact: after
POST /appAuth/batchDeletein a non-default namespace (e.g.ns-A), gateways ofns-Akeep the deleted appKey/secret, and signed requests with it are still accepted. If the default namespace has an app auth with the same appKey, that one is wrongly removed instead.What this PR does
namespaceIdon everyAppAuthDataof the DELETE event. A missing value on a legacy row falls back toSYS_DEFAULT_NAMESPACE_ID, the same default the listeners use, so the delete is never rolled back by an NPE.DataChangedEvent(APP_AUTH, DELETE, data, namespaceId)per namespace. A batch spanning several namespaces is no longer routed by its first item only (findFirst()in the node listeners).Delivery timing is unchanged:
DataChangedEventDispatcherstill defers every event toafterCommit. In cluster mode,ClusterDataChangedEventForwarderalready forwards the event'snamespaceIdto the master.Tests
AppAuthServiceTest:ns-Aand in the default namespace keeps the namespace on both the event and its datans-A×2,ns-B, default) publishes exactly 3 events, each with only its own app authsMake sure that:
./mvnw clean install -Dmaven.javadoc.skip=true.