Skip to content

fix(core): support Opinion code/msg envelopes#962

Open
realfishsam wants to merge 1 commit into
mainfrom
fix/easy-opinion-envelope
Open

fix(core): support Opinion code/msg envelopes#962
realfishsam wants to merge 1 commit into
mainfrom
fix/easy-opinion-envelope

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Accept Opinion REST envelopes using documented code/msg fields while preserving legacy errno/errmsg compatibility.
  • Apply the same error-code normalization to Opinion order submission and cancellation responses.
  • Add targeted fetcher tests for documented success/error envelopes and legacy compatibility.

Fixes #416

Test Plan

  • npm test --workspace=pmxt-core -- --runTestsByPath test/exchanges/opinion-fetcher-envelope.test.ts --runInBand

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Updates Opinion API envelope handling to accept both documented code/msg envelopes and legacy errno/errmsg envelopes.

Blast Radius

Opinion fetcher/index plus targeted envelope Jest tests.

Consumer Verification

Before (base branch):
Base treated errno as required, so a documented {code:0,msg:"success"} success envelope could be misclassified because data.errno !== 0 when errno is undefined.

After (PR branch):
PR computes code ?? errno, uses msg || errmsg, and adds tests for success/error/legacy envelopes. Core build/Jest passed (25 suites, 647 tests); root verification then hit missing pytest.

Test Results

  • Build: PASS
  • Unit tests: CORE PASS (25 suites, 647 tests; root verification blocked by missing pytest)
  • Server starts: PASS during root verification
  • E2E smoke: NOT VERIFIED against live Opinion API

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A
  • OpenAPI sync: N/A
  • Financial precision: N/A
  • Type safety: OK
  • Auth safety: OK

Semver Impact

patch -- venue response-envelope bug fix.

Risk

Live Opinion API behavior was not sampled; mocked envelope tests cover the concrete drift.

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.

Spec drift: opinion — REST response envelope uses errno/errmsg in code but docs specify code/msg

1 participant