Skip to content

feat: #29 Implement frontend order recovery from coordinator API#41

Open
BuddiBisong wants to merge 4 commits into
karagozemin:masterfrom
BuddiBisong:feature/order-recovery
Open

feat: #29 Implement frontend order recovery from coordinator API#41
BuddiBisong wants to merge 4 commits into
karagozemin:masterfrom
BuddiBisong:feature/order-recovery

Conversation

@BuddiBisong

@BuddiBisong BuddiBisong commented Jun 25, 2026

Copy link
Copy Markdown

Closes #29


  • Add orderRecovery service with coordinator integration
  • Implement useOrderRecovery hook for automatic order fetching
  • Add smart deduplication logic preserving local refund state
  • Update TransactionHistory to recover pending orders after reload
  • Enhance coordinator /orders/history endpoint for multi-address queries
  • Add comprehensive test coverage for recovery, dedup, and failure scenarios
  • Support both v1-mainnet-htlc and v2-escrow contract modes
  • Graceful fallback to local storage on coordinator unavailability

Fixes Wave 6 #29: Pending/refundable swaps now survive page reloads

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the karagoz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@BuddiBisong 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! 🚀

Learn more about application limits

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the PR. I checked it against issue #29 and cannot merge it yet.

Blocking issues:

  • The new /api/orders/history route is currently registered after /orders/:id in coordinator/src/server/routes/orders.ts, so /api/orders/history is treated as an order id and returns 404. That breaks the recovery path the frontend depends on.
  • pnpm --filter @oversync/frontend test -- --run fails: orderRecovery.test.ts has 4 failing cases, including the runtime ReferenceError from for (const recovered of recovered).
  • pnpm --filter @oversync/frontend build fails with TypeScript errors in TransactionHistory.tsx, orderRecovery.ts, and useOrderRecovery.ts. Notable blockers: Order.createdAtMs does not exist, null values are assigned to optional string fields, unused imports/state, and the recovered variable shadowing bug.

Please move the history route before /orders/:id or otherwise make it reachable, then get the frontend tests and build green. After that I can re-review for #29 acceptance.

@BuddiBisong
BuddiBisong force-pushed the feature/order-recovery branch from af7fbf6 to 510fd3a Compare June 28, 2026 23:34
@karagozemin

karagozemin commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Thanks for the update. I re-ran the review after your latest commits.

What now passes:

  • pnpm install --frozen-lockfile
  • pnpm --filter @oversync/frontend test -- --run — 48 tests passed
  • pnpm --filter @oversync/sdk build && pnpm --filter @oversync/frontend build — passed
  • pnpm --filter @oversync/coordinator test — passed

Remaining blocker before I can merge:

  • git diff --check origin/master...HEAD fails because the PR still introduces trailing whitespace in:
    • coordinator/src/server/routes/orders.ts
    • frontend/src/components/TransactionHistory.tsx
    • frontend/src/lib/orderRecovery.integration.test.ts

Please strip the trailing whitespace and push one more update. The functional blockers from the previous review look resolved.

@BuddiBisong

Copy link
Copy Markdown
Author

I have removed the trailing white Space in the specified files Pls merge

@karagozemin

Copy link
Copy Markdown
Owner

Re-checked the latest head after the whitespace update. The frontend tests pass now, but the frontend build still fails, so I cannot merge.

Passed:

  • pnpm --filter @oversync/frontend test -- --run => 85 tests passed

Failing command:

pnpm --filter @oversync/frontend build

Errors:

src/components/TransactionHistory.tsx(414,20): error TS2304: Cannot find name `CopyableIdentifier`.
src/components/TransactionHistory.tsx(464,16): error TS2304: Cannot find name `OrderStaleBanner`.
src/components/TransactionHistory.tsx(465,28): error TS2304: Cannot find name `classifyOrderFreshness`.
src/lib/orderRecovery.ts(63,83): error TS2339: Property `createdAt` does not exist on type `Order`.

Please restore the missing imports/usages in TransactionHistory.tsx and align the recovered-order typing with the SDK Order type. Then rerun:

pnpm --filter @oversync/frontend test -- --run
pnpm --filter @oversync/frontend build
pnpm --filter @oversync/sdk build
git diff --check origin/master...HEAD

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the update. I rechecked this under the karagozemin account.

Passing checks:

  • git diff --check origin/master...HEAD
  • pnpm --filter @oversync/sdk build
  • pnpm --filter @oversync/frontend test -- --run (107 tests pass)
  • pnpm --filter @oversync/frontend build
  • pnpm --filter @oversync/coordinator test (54 tests pass)

The previous functional build blockers are fixed. I still cannot merge this exact branch because it includes unrelated documentation churn outside issue #29's scope, including edits to:

  • ROADMAP.md
  • docs/DILIGENCE_DATA_ROOM.md
  • docs/ECOSYSTEM_INTEGRATION.md
  • docs/GOVERNANCE_PATH.md
  • docs/KPI_DASHBOARD_SPEC.md
  • docs/SCF_EVIDENCE.md
  • WAVE_6_ISSUE_29_IMPLEMENTATION.md

Most of those doc diffs are whitespace/formatting changes and are not needed for frontend order recovery. Please remove the unrelated docs/report file from this PR so the diff stays focused on:

  • frontend/src/lib/orderRecovery*
  • frontend/src/lib/useOrderRecovery*
  • frontend/src/components/TransactionHistory.tsx
  • the coordinator history endpoint change, if needed
  • the SDK type addition, if needed

After the scope cleanup, this looks ready to merge if the same checks stay green.

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the cleanup commit. I rechecked the latest merge ref from the maintainer account.

Passing checks:

git diff --check master...pr-41-merge
pnpm --filter @oversync/sdk build
pnpm --filter @oversync/frontend test -- --run
pnpm --filter @oversync/frontend build
pnpm --filter @oversync/coordinator test

Results: frontend tests pass (107), frontend build passes, coordinator tests pass (79).

I still cannot merge this branch because the scope cleanup is not complete. The current diff still modifies/deletes unrelated documentation outside issue #29:

M ROADMAP.md
D docs/DILIGENCE_DATA_ROOM.md
D docs/ECOSYSTEM_INTEGRATION.md
D docs/GOVERNANCE_PATH.md
D docs/KPI_DASHBOARD_SPEC.md
D docs/SCF_EVIDENCE.md

Those docs should not be deleted by the frontend order recovery PR. Please restore/remove those doc changes from the branch so the diff is focused on the order recovery files, coordinator history route change, and SDK type addition only. Once the docs deletion is gone, this looks ready to merge if the same checks stay green.

@BuddiBisong
BuddiBisong force-pushed the feature/order-recovery branch from 68257a7 to fc15377 Compare June 30, 2026 09:46
@BuddiBisong

Copy link
Copy Markdown
Author

Done

@BuddiBisong

Copy link
Copy Markdown
Author

Pls Merge

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the cleanup. I rechecked the merge ref from the maintainer account and the functional checks are green:

git diff --check master...pr-41-merge
pnpm --filter @oversync/sdk build
pnpm --filter @oversync/frontend test -- --run
pnpm --filter @oversync/frontend build
pnpm --filter @oversync/coordinator test

Results: frontend tests pass (108), frontend build passes, coordinator tests pass (85), and the unrelated docs deletion is gone.

I tried to merge, but GitHub now reports the branch as DIRTY / CONFLICTING against the latest master after recent merges. Please rebase or merge current master, resolve the conflicts, and push again. This looks ready once GitHub can merge it and the same checks stay green.

@BuddiBisong

Copy link
Copy Markdown
Author

But its showing no conflict with base branch

@BuddiBisong

Copy link
Copy Markdown
Author

All checks have passed on the locally and on my forked repo pls merge

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the PR! The code builds fine locally ✅, but GitHub reports merge conflicts with the base branch. Could you rebase onto the latest master and resolve the conflicts? Once it's mergeable I'll get it merged. 🙏

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.

[Wave 6 6/10] Frontend order recovery from coordinator API after reload

3 participants