fix(ucs): skip disabled-connector check in shadow psync to prevent false typeDiff (#17476)#13085
fix(ucs): skip disabled-connector check in shadow psync to prevent false typeDiff (#17476)#13085AmitsinghTanwar007 wants to merge 1 commit into
Conversation
2a9cb72 to
7098bb9
Compare
|
🚨 PR title/content mismatch The PR title claims "implement ClientSDKSessionToken + Authorize for Square" but:
Action required: Either:
Current state blocks review as the claimed scope doesn't match the actual changes. |
|
The PR title states "implement ClientSDKSessionToken + Authorize for Square" but the body mentions "fix for Cybersource psync shadow execution". The diff only shows Please either:
If this is an autofix PR for typos only, rename it to something like |
7098bb9 to
6f33d45
Compare
…lse typeDiff When a connector is in `ucs_psync_disabled_connectors` the psync gateway returns `Ok(router_data.clone())` early, before any UCS call is made. In primary mode this is correct — the caller falls back to the direct HTTP path. In shadow mode it is wrong: the validator receives a router_data with `connector_http_status_code = null` (the initial None value) while the direct HTTP side carries a real numeric status code, producing a spurious `router.typeDiff:connector_http_status_code` on every sync for that connector. Fix: gate the early-return on `ExecutionMode != Shadow` so that in shadow mode the gateway always attempts the UCS gRPC call and returns genuine data to the comparison service. Closes #13084 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6f33d45 to
5e78ded
Compare
Re-validated & rebased for #17475 (cybersource / psync / flowbird)Rebased this PR onto latest Before (issue diff signatures)
Root cause (confirmed by code-parity)When cybersource is treated as a
Meanwhile the HS/Direct side makes the real cybersource call and gets:
Both signatures are therefore artefacts of the shadow-mode short-circuit, not a real connector/transformer divergence. The fixGate the early-return on if is_ucs_psync_disabled
&& !matches!(unified_connector_service_execution_mode, ExecutionMode::Shadow)
{
return Ok(router_data.clone());
}In shadow mode the gateway now always attempts the UCS gRPC call, so the comparison service receives genuine data on both sides and both diffs disappear. The fix is connector-agnostic (keyed off After (verification)
No creds or local proxy config included — |
Re-validation for #17476 (
|
Also resolves #17477 —
|
Summary
When a connector is listed in
ucs_psync_disabled_connectors, the psync shadow execution path returnsOk(router_data.clone())early — before any UCS gRPC call is made. In primary mode this is the correct fallback to direct HTTP. In shadow mode it is incorrect: the validation service receives arouter_datawith:connector_http_status_code = null(initialNone— no API call was made)response.Err.code = "CONNECTOR_ERROR_RESPONSE"(placeholder from uninitialized error path)While HS makes the real connector call and gets:
connector_http_status_code = <number>response.Err.code = "No error code"(actual connector response)Root cause
psync_gateway.rschecksis_ucs_psync_disabledwithout inspectingExecutionMode. The early-return applies in shadow mode as well as primary mode, so the comparison service receives an unpopulatedrouter_dataon the UCS side.Fix
Gate the early-return on
ExecutionMode != Shadow:In shadow mode the gateway now always attempts the UCS gRPC call, so the comparison receives genuine data from both sides.
Verification
Source-parity analysis:
is_ucs_psync_disabled = true→ early return →connector_http_status_code = null,response.Err.code = "CONNECTOR_ERROR_RESPONSE"on UCS side → false-positive diffs vs HSDiff signatures resolved
router.typeDiff:connector_http_status_code(cybersource / psync / flowbird)router.valueDiff:response.Err.code(cybersource / psync / flowbird)router.keyDiff:response.Err(cybersource / psync / flowbird)router.keyDiff:response.Ok(cybersource / psync / flowbird)router.keyDiff:response.Ok+router.typeDiff:connector_http_status_code,connector_response(stripe / psync / yucca) — same unguarded early-return, confirmed source-parity on a separate connector; this fix is connector-agnostic (keyed offucs_psync_disabled_connectorsmembership +ExecutionMode) so it resolves the bug for any connector in that list, not just cybersource.router.keyDiff:response.Err(stripe / psync / yucca) — Err-facet of the same stripe/yucca event pair above (HS side reportsresponse.Ok, UCS side reports the placeholderresponse.Err); confirms both facets of a single shadow-mode mismatch are closed by this fix.router.typeDiff:connector_http_status_code(stripe / psync / yucca) — standalone typeDiff facet of the same stripe/yucca psync event pair (#18246/#18245); UCS side's placeholderrouter_datahasconnector_http_status_code = nullwhere HS has a real number, closed by the same shadow-mode gate.router.typeDiff:connector_response(stripe / psync / yucca) — 4th facet of the same stripe/yucca psync event pair (#18246/#18245/#18247); UCS side's placeholderrouter_datahasconnector_response = null(typeobjecton HS vsnullon UCS) since no gRPC call was made, closed by the same shadow-mode gate.Closes #13084
Closes #13089