Implement shared failure-code catalog for order lifecycle errors#50
Implement shared failure-code catalog for order lifecycle errors#50K1NGD4VID wants to merge 9 commits into
Conversation
|
@K1NGD4VID is attempting to deploy a commit to the karagoz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@K1NGD4VID Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Thanks for the failure-code catalog work. I checked this against #48 and cannot merge it yet because multiple required checks fail. Commands run:
Blocking failures:
This occurs when constructing
Please fix the package exports/build path so consumers can import those symbols.
After fixes, please rerun:
Then I can re-review the actual #48 acceptance criteria. |
|
Thanks for the follow-up. I re-ran the checks on the latest commit. The whitespace issue is fixed and the frontend vitest suite passes, but this still cannot be merged yet. Commands run: Remaining blockers:
|
…lves without a build step
The SDK exports map (and main/types fields) pointed every entry at
./dist/<name>/index.{js,d.ts}. When dist/ was missing, stale, or empty,
consumers silently got undefined for FAILURE_CODE_CATALOG at runtime
and TS2305 'no exported member' from tsc -- a single shared root cause
behind the coordinator API error mapper TypeError and the frontend
TransactionHistory TS2305 errors.
Switch every exports entry plus main/types to ./src/<name>.ts. With
moduleResolution: bundler in coordinator and frontend tsconfigs,
tsc + vite + vitest + tsx consume the TS source directly, so no
precompiled dist artifact is required for dev or test.
Also:
- Add 'sideEffects': false on the SDK package for tree-shaking.
- Add a 'default' condition on every exports entry so future
require() callers don't hit ERR_PACKAGE_PATH_NOT_EXPORTED.
- Pre-bundle @oversync/sdk and @oversync/sdk/types in frontend
vite.optimizeDeps.include to absorb the new on-the-fly esbuild scan.
- Add packages/sdk/test/exports.test.ts which imports the catalog via
the package subpath, the package main entry, and the source shortcut,
with toBeDefined() guards and an exhaustive switch terminating in
const _: never = code so any future FailureCode drift fails tsc at
compile time and fails vitest loudly if exports silently resolve to
undefined again.
Verified: SDK 31/31 vitest passes, all three (SDK, coordinator,
frontend) tsc --noEmit pass, frontend full 'tsc && vite build' passes.
|
I checked the current PR state before reviewing code, and GitHub still reports this branch as Please rebase or merge latest |
* upstream/master: ~40 commits including:
- feat(frontend): add HTLC lifecycle timeline, stale order banner
- feat(coordinator): add aggregate order metrics endpoint
- feat(resolver): add dry-run readiness command
- feat(sdk): add capability matrix, explorer URL helpers
- Various docs, CI, and relayer improvements
Conflicts resolved:
- coordinator/src/services/order-service.ts: kept both getOrderMetrics()
and failureCode parameter in markStatus()
- frontend/src/components/TransactionHistory.tsx: kept both HtlcTimeline
and FAILURE_CODE_CATALOG imports
|
@karagozemin Please review it now |
|
Thanks for the update. I rechecked this from the merge ref under the karagozemin account. Passing checks:
Still blocked:
Please update the SDK subpath export / workspace resolution so coordinator tests can import |
- Add @oversync/sdk to vitest deps.inline so Vite resolves the workspace package's TS source files for subpath exports - Export sendError from orders.ts and use it in secrets.ts for consistent VALIDATION_FAILED responses - Update http-routes.test.ts expectations from validation_error to VALIDATION_FAILED
|
Please reveiw and merge @karagozemin |
|
Thanks for the update. I rechecked the merge ref from the maintainer account. The SDK checks pass, but coordinator tests fail and the PR still contains a generated DB file. Commands run: git diff --check master...pr-50-merge
pnpm --filter @oversync/sdk test
pnpm --filter @oversync/sdk build
pnpm --filter @oversync/coordinator testPassing: Failing: Please fix the coordinator import/build path for the shared failure-code types, or export/import the catalog from a package path that Vitest can resolve in the workspace. Also please remove |
…ed DB - Switch all @oversync/sdk/types imports to @oversync/sdk (main entry already re-exports types/index.ts). Avoids Vitest subpath resolution issues with workspace-linked packages. - Remove coordinator/oversync.db from git tracking and add *.db to .gitignore so generated SQLite files aren't committed. - Remove @oversync/sdk/types from frontend optimizeDeps.include since that subpath is no longer imported directly.
* upstream/master: ~15 commits including:
- feat(frontend): add deployment self-check, backend status banner,
HTLC receipt card, investor demo mode
- feat(resolver): add read-only preflight command
- feat(coordinator): add CORS allowlist validation, order transitions
- Various docs, CI, and validation scripts
Conflicts resolved:
- coordinator/src/server/routes/orders.ts: kept upstream's GET /orders/:id
and GET /orders/:id/transitions with sendError-style error handling;
removed duplicate route
- coordinator/src/persistence/orders-repo.ts: kept both getTransitions()
and failureCode parameter on setStatus
…ode-catalog # Conflicts: # coordinator/src/server/routes/orders.ts # packages/sdk/src/types/index.ts
|
Kindly review and merge @karagozemin |
|
Rechecked: thanks for the updates. However this PR now has merge conflicts with |
|
fixed please review now @karagozemin |
closes #48