Summary
Thread instanceUrl from request context through entity handler call sites to avoid cross-request state leakage in concurrent OAuth traffic.
Context
PR #396 added an optional instanceUrl parameter to WidgetAvailability.validateWidgetParams, WidgetAvailability.isWidgetAvailable, WidgetAvailability.getAvailableWidgets, and related ToolAvailability / RegistryManager APIs. The JSDoc on validateWidgetParams (lines 161–164) documents that request-context callers should pass the per-request URL to avoid reading the wrong tier/version under concurrent OAuth traffic.
However, the call sites inside entity handlers were not updated in PR #396 because they involve a broader handler argument-passing change across all entities.
Work needed
References
Requested by
@polaz
Summary
Thread
instanceUrlfrom request context through entity handler call sites to avoid cross-request state leakage in concurrent OAuth traffic.Context
PR #396 added an optional
instanceUrlparameter toWidgetAvailability.validateWidgetParams,WidgetAvailability.isWidgetAvailable,WidgetAvailability.getAvailableWidgets, and relatedToolAvailability/RegistryManagerAPIs. The JSDoc onvalidateWidgetParams(lines 161–164) documents that request-context callers should pass the per-request URL to avoid reading the wrong tier/version under concurrent OAuth traffic.However, the call sites inside entity handlers were not updated in PR #396 because they involve a broader handler argument-passing change across all entities.
Work needed
src/entities/workitems/registry.ts: threadinstanceUrl(obtained fromgetGitLabApiUrlFromContext()) intoWidgetAvailability.validateWidgetParams(widgetParams, instanceUrl).ConnectionManager.getClient()orgetInstanceInfo()without an explicitinstanceUrland thread the request-scoped URL through.ConnectionManager.currentInstanceUrlimplicitly.References
Requested by
@polaz