Skip to content

feat: re-apply dual send for transport v2 (Phase B) without Riverpod 3.x#629

Closed
grunch wants to merge 6 commits into
revert/riverpod-3x-rollbackfrom
feat/transport-v2-phase-b-reapply
Closed

feat: re-apply dual send for transport v2 (Phase B) without Riverpod 3.x#629
grunch wants to merge 6 commits into
revert/riverpod-3x-rollbackfrom
feat/transport-v2-phase-b-reapply

Conversation

@grunch

@grunch grunch commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Re-applies the content of #624 (dual send for transport v2, Phase B) on top of the rollback, without any Riverpod 3.x changes from #613.

This is a clean cherry-pick of the original #624 commit onto the reverted (Riverpod 2.6.1) base. The diff is byte-identical to the original #624 delta and contains no Riverpod 3.x API usage (only ref.read(settingsProvider), which is identical in Riverpod 2.x and 3.x).

Contents

  • NIP-44 dual-receive/dual-send transport logic (mostro_message.dart, mostro_service.dart)
  • Restore manager decode path + tests
  • Transport v2 migration docs

Dependency

Original author: Andrea Diaz (preserved via cherry-pick).

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07006766-d467-489f-8a05-f0c1be47501e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/transport-v2-phase-b-reapply

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b82dd4e278

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
final wrappedEvent = await mostroMessage.wrap(
final wrappedEvent = await mostroMessage.wrapForTransport(
protocolVersion: mostroInstance?.protocolVersion,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid defaulting restore sends to v1 before node info loads

When restore starts before the kind-38385 info event has populated mostroInstance, this passes null into wrapForTransport, which resolves to the v1 gift-wrap path. The subscription above already accounts for this race by listening on both transports, but the outbound restore request still goes out only as kind 1059, so a protocol-v2-only node never sees it and the restore times out. Please wait for the node protocol info or dual-send restore requests while the protocol is unknown.

Useful? React with 👍 / 👎.

AndreaDiazCorreia and others added 5 commits June 23, 2026 21:32
revert: roll back Riverpod 3.x migration (#613) and dependent PRs (#624, #625)
…ests

- Add _waitForNodeConnectivity to ensure the app is connected to the selected node before restore
- Engage bootstrap relays immediately and wait for kind 38385 info event to prove connectivity
- Fall back to best-effort attempt if info event not received within discovery window
- Add _initRetryTimer to OpenOrdersRepository to poll for NostrService readiness
- Defer order subscription until NostrService.isInitialized to avoid
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
fix: resolve provider init and node-switch restore connectivity races
* feat(transport): implement protocol v2 (NIP-44 direct) send path with identity proof (Phase B)

* feat(transport): route all outbound Mostro sends through wrapForTransport (Phase B)

* feat(restore): add dual-receive support for transport v2 (NIP-44 direct) in restore flow

* test(restore): add dual-receive transport v2 regression tests for restore flow

* fix(transport): bind dispute identity proof and guard restore tuple

- DisputeRepository.createDispute now passes masterKey/keyIndex to
  wrapForTransport so reputation-mode disputes carry the v2 identity
  proof instead of being silently downgraded to full-privacy, matching
  publishOrder.
- decodeRestoreMessage guards against an empty JSON tuple before
  indexing [0] to avoid a RangeError.
- Refresh stale NIP-59-only comments in the dispute send path.

---------

Co-authored-by: grunch <fjcalderon@gmail.com>
@AndreaDiazCorreia AndreaDiazCorreia force-pushed the feat/transport-v2-phase-b-reapply branch from b82dd4e to 90723bd Compare June 24, 2026 01:13
…ion reset

- Add RestoreService.isOperationInProgress and awaitOperationCompletion() to expose restore/sync state
- AddOrderNotifier.submitOrder now waits for any in-flight restore to finish before creating an order
- Prevents session orphaning when node-switch restore's _clearAll wipes sessions mid-order-creation
@AndreaDiazCorreia

Copy link
Copy Markdown
Member

This PR has been closed and #632 has been opened in its place.

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.

2 participants