Skip to content

refactor(web-client): read borrows#29

Open
WiktorStarczewski wants to merge 6 commits into
mainfrom
wiktor/migrate-2080-read-borrows
Open

refactor(web-client): read borrows#29
WiktorStarczewski wants to merge 6 commits into
mainfrom
wiktor/migrate-2080-read-borrows

Conversation

@WiktorStarczewski
Copy link
Copy Markdown
Collaborator

@WiktorStarczewski WiktorStarczewski commented Apr 28, 2026

Migrated from miden-client#2080 (author: @igamigo) as part of the web-sdk split (#1992 / #2135).

The miden-client/Rust-side changes from the original PR remain on miden-client#2080. (Note: the upstream PR was closed without merging; this web-sdk-side migration compiles cleanly against current main miden-client without needing the upstream change, so it's self-contained.)

Migrated from 0xMiden/miden-client#2080 (author: igamigo) as part of
the web-sdk split. Original PR: 0xMiden/miden-client#2080

The patch contains 3-way merge conflicts; resolution needed before merge.
Copy link
Copy Markdown
Collaborator

@SantiagoPittella SantiagoPittella left a comment

Choose a reason for hiding this comment

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

I see that there is a small difference with the original PR by @igamigo , this does not include the changes to the docs/typedoc/web-client/classes/MidenClient.md and CHANGELOG.md

Resolves the committed conflict markers in:
  - crates/web-client/src/account.rs (get_accounts):
      The function header above the conflict was already migrated to the
      new pattern (`let client = self.get_inner()?;` instead of
      `if let Some(client) = self.get_mut_inner()`). The 'ours' branch of
      the conflict still had the old body — including an orphan `else`
      clause without a matching `if let`. Take 'theirs' (flat
      `Ok(result.into_iter()...)`) which matches the surrounding code.

  - crates/web-client/src/export.rs (export_account_file):
      Same as above — the function had already been migrated; only the
      indentation differed between sides. Take 'theirs' (8-space indent
      matches the rest of the function body).

  - crates/web-client/src/tags.rs (list_tags):
      'ours' is the pre-refactor pattern (`&mut self` + get_mut_inner +
      if-let), 'theirs' is the new pattern (`&self` + get_inner?). Take
      'theirs' — this is the migration's whole point.

cargo check --workspace --target wasm32-unknown-unknown is clean against
current main (miden-client 0.14.4 from crates.io). No dep retarget needed
— upstream miden-client#2080 was closed without merging, and the web-sdk
infrastructure already supports the read-borrow signatures.
@WiktorStarczewski WiktorStarczewski added the no changelog PR doesn't need a CHANGELOG entry (trivial / non-user-visible) label Apr 30, 2026
Apply nightly cargo fmt to the 3 conflict-resolved files. Also picks up
pre-existing format drift in unrelated parts of those files that the
upstream PR's cargo fmt commit (commit 'style: cargo fmt' on the original
miden-client#2080) would have caught.
Reviewer feedback (@SantiagoPittella) noted that the migration of
miden-client#2080 didn't carry the original PR's CHANGELOG entry over
to web-sdk. This commit ports it.

The original PR also touched docs/typedoc/web-client/classes/MidenClient.md
on the miden-client side, but those edits were for lastAuthError() (from
miden-client#2058) and waitForIdle() (from miden-client#2057) — both
unrelated to the read-borrows refactor that #2080/this PR ships, and
both were just riding along on the upstream branch. Web-sdk also doesn't
check in typedoc output, so there's no equivalent file to update here.
@WiktorStarczewski WiktorStarczewski removed the no changelog PR doesn't need a CHANGELOG entry (trivial / non-user-visible) label Apr 30, 2026
WiktorStarczewski added a commit that referenced this pull request Apr 30, 2026
Observed flake: probe returns HTTP 200 once on the first attempt that
clears the connection-refused phase, exits, tests start, ALL tests fail
with 'TypeError: Failed to fetch' to the gRPC backend. The single-probe
gate isn't strict enough — a one-shot 200 (e.g. tonic-health responding
before the rest of the dispatcher is fully wired) currently passes.

Upgrade the readiness signal to N consecutive HTTP successes spaced
PROBE_INTERVAL apart (defaults: 3 successes, 0.5s apart), so the probe
only declares the server ready after ~1s of demonstrably-stable
response. Any non-success in the streak resets it to zero and the
slow-poll loop resumes — so a momentary blip during init doesn't get
counted twice on either side.

Tracked occurrences across recent PR runs: web-sdk PR #23 ci-shard-4,
PR #29 ci-shard-1 + ci-shard-4, PR #27 multiple shards.
WiktorStarczewski added a commit that referenced this pull request Apr 30, 2026
Observed flake: probe returns HTTP 200 once on the first attempt that
clears the connection-refused phase, exits, tests start, ALL tests fail
with 'TypeError: Failed to fetch' to the gRPC backend. The single-probe
gate isn't strict enough — a one-shot 200 (e.g. tonic-health responding
before the rest of the dispatcher is fully wired) currently passes.

Upgrade the readiness signal to N consecutive HTTP successes spaced
PROBE_INTERVAL apart (defaults: 3 successes, 0.5s apart), so the probe
only declares the server ready after ~1s of demonstrably-stable
response. Any non-success in the streak resets it to zero and the
slow-poll loop resumes — so a momentary blip during init doesn't get
counted twice on either side.

Tracked occurrences across recent PR runs: web-sdk PR #23 ci-shard-4,
PR #29 ci-shard-1 + ci-shard-4, PR #27 multiple shards.
WiktorStarczewski added a commit that referenced this pull request Apr 30, 2026
Observed flake: probe returns HTTP 200 once on the first attempt that
clears the connection-refused phase, exits, tests start, ALL tests fail
with 'TypeError: Failed to fetch' to the gRPC backend. The single-probe
gate isn't strict enough — a one-shot 200 (e.g. tonic-health responding
before the rest of the dispatcher is fully wired) currently passes.

Upgrade the readiness signal to N consecutive HTTP successes spaced
PROBE_INTERVAL apart (defaults: 3 successes, 0.5s apart), so the probe
only declares the server ready after ~1s of demonstrably-stable
response. Any non-success in the streak resets it to zero and the
slow-poll loop resumes — so a momentary blip during init doesn't get
counted twice on either side.

Tracked occurrences across recent PR runs: web-sdk PR #23 ci-shard-4,
PR #29 ci-shard-1 + ci-shard-4, PR #27 multiple shards.
WiktorStarczewski added a commit that referenced this pull request Apr 30, 2026
Observed flake: probe returns HTTP 200 once on the first attempt that
clears the connection-refused phase, exits, tests start, ALL tests fail
with 'TypeError: Failed to fetch' to the gRPC backend. The single-probe
gate isn't strict enough — a one-shot 200 (e.g. tonic-health responding
before the rest of the dispatcher is fully wired) currently passes.

Upgrade the readiness signal to N consecutive HTTP successes spaced
PROBE_INTERVAL apart (defaults: 3 successes, 0.5s apart), so the probe
only declares the server ready after ~1s of demonstrably-stable
response. Any non-success in the streak resets it to zero and the
slow-poll loop resumes — so a momentary blip during init doesn't get
counted twice on either side.

Tracked occurrences across recent PR runs: web-sdk PR #23 ci-shard-4,
PR #29 ci-shard-1 + ci-shard-4, PR #27 multiple shards.
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