Skip to content

refactor(web-client): read borrows#29

Open
WiktorStarczewski wants to merge 1 commit into
nextfrom
wiktor/migrate-2080-read-borrows
Open

refactor(web-client): read borrows#29
WiktorStarczewski wants to merge 1 commit into
nextfrom
wiktor/migrate-2080-read-borrows

Conversation

@WiktorStarczewski

@WiktorStarczewski WiktorStarczewski commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

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.)

@SantiagoPittella SantiagoPittella left a comment

Copy link
Copy Markdown
Collaborator

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

@WiktorStarczewski WiktorStarczewski added no changelog PR doesn't need a CHANGELOG entry (trivial / non-user-visible) and removed no changelog PR doesn't need a CHANGELOG entry (trivial / non-user-visible) labels 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.
@igamigo igamigo force-pushed the wiktor/migrate-2080-read-borrows branch from 8f86acf to 3396960 Compare June 11, 2026 18:36
@igamigo igamigo changed the base branch from main to next June 11, 2026 18:37
Migrated from 0xMiden/miden-client#2080 (author: igamigo) as part of
the web-sdk split. Original PR: 0xMiden/miden-client#2080

Read-only WebClient methods now take a shared borrow of the inner
client (guard.as_ref()), and the JS proxy routes them through a
readers-writer lock so reads run in parallel while writes run alone.
The _withInnerWebClient re-entrancy fast path is preserved for both
the read and write paths.
@igamigo igamigo force-pushed the wiktor/migrate-2080-read-borrows branch from 3396960 to d9e19af Compare June 11, 2026 19:16
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