VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

The Gold Standard of Websites | Separating Transferred ReadableStream Source Locking from Destination-Side Reading

Transferring an unlocked ReadableStream does not copy its queue into a second independent stream. The transfer steps build a cross-realm pipe, serialize a MessagePort-backed representation and leave the original readable locked. The receiving realm reconstructs a new readable that can be read. Source-side unusability and destination-side capability are therefore two results of one handoff, not contradictory states.

This specialist guide belongs to the Websites root. It also connects to The Gold Standard of Education | Learning That Transfers into Life and the How X Works hub. The worked cases are original teaching examples; their values and event logs are stated so each conclusion can be checked.

eduKateSG · Websites

Find your next learning step

Follow an original stream that produces the chunks A and B. Transfer it through postMessage, try to acquire a reader from the original, and then read A and B from the receiving realm. Keep the original stream, the internal writable side, the transferred port and the reconstructed readable in separate rows. Then repeat with an already locked source, cancellation, ordinary close and a producer error.

ROUTE 1 · CHAPTERS 1–3

Build the first model

Name the input, state, conversion or predicate before following user-visible results.

ROUTE 2 · CHAPTERS 4–5

Trace the decisive branch

Work the accepted path and the nearest boundary case with original examples.

ROUTE 3 · CHAPTERS 6–8

Change one premise

Rebuild the mechanism when state, value, realm, timing or object kind changes.

ROUTE 4 · CHAPTERS 9–10

Handle limits and failures

Keep abrupt completion, availability and application limits visible.

ROUTE 5 · CHAPTERS 11–12

Verify and explain

Use a decisive fixture, changed-context check and concise final account.

Full chapter contents · Websites subject guide

Chapter contents

Build the first model · Chapters 1–3

1. Separate transfer from cloning

2. Check the unlocked precondition

3. Create the internal port pair

Trace the decisive branch · Chapters 4–5

4. Pipe the source into the cross-realm writable

5. Lock the original source

Change one premise · Chapters 6–8

6. Reconstruct the destination readable

7. Read chunks in destination order

8. Preserve backpressure across the realm boundary

Handle limits and failures · Chapters 9–10

9. Propagate ordinary close

10. Propagate producer error

Verify and explain · Chapters 11–12

11. Route destination cancellation

12. Build a transfer receipt

CHAPTER 1 OF 12 · Build the first model

1. Separate transfer from cloning

Back to contents

The short answer is that a transferred readable is represented by a cross-realm pipe rather than duplicated as an independent queue. Chapter 1 focuses on separate transfer from cloning. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. create source S with chunks A and B, transfer S once and label the receiving stream D. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for separate transfer from cloning is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. structured-clone a plain array [A,B] and compare the absence of live stream state. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: equal chunk values do not prove equal stream identity or independent ownership. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. record object identity, lock state and which realm can call getReader. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of separate transfer from cloning should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Next chapter

CHAPTER 2 OF 12 · Build the first model

2. Check the unlocked precondition

Back to contents

The short answer is that the transfer steps throw a DataCloneError when the readable is already locked. Chapter 2 focuses on check the unlocked precondition. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. acquire reader R from S before postMessage and attempt to include S in the transfer list. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for check the unlocked precondition is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. release R first and repeat the transfer with the same source state. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: a disturbed stream and a locked stream are different facts; the specified eligibility check is locking. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. assert S.locked immediately before serialization and whether a destination object is created. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of check the unlocked precondition should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 3 OF 12 · Build the first model

3. Create the internal port pair

Back to contents

The short answer is that transfer creates entangled MessagePorts that carry demand, chunks and terminal messages across realms. Chapter 3 focuses on create the internal port pair. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. name the local port P1 and transferred port P2 before any chunk crosses. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for create the internal port pair is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. close a separate unrelated port and show that it has no effect on P1 or P2. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: ports are transport plumbing for stream operations and not the stream chunks themselves. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. log port identity, entanglement role and every message label. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of create the internal port pair should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 4 OF 12 · Trace the decisive branch

4. Pipe the source into the cross-realm writable

Back to contents

The short answer is that the original readable is piped to a writable whose writes post chunks toward the receiving side. Chapter 4 focuses on pipe the source into the cross-realm writable. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. let S pull A only after the internal writable has demand and trace pipeTo through write(A). Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for pipe the source into the cross-realm writable is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. make A available before transfer and show that it still crosses through the pipe rather than becoming a clone snapshot. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: the pipe promise is internal transfer machinery and is not a delivery receipt from application code. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. record source pull, internal write, port post and pipe settlement separately. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of pipe the source into the cross-realm writable should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 5 OF 12 · Trace the decisive branch

5. Lock the original source

Back to contents

The short answer is that pipeTo acquires a reader for the original readable, so the source becomes locked and cannot be read directly after transfer. Chapter 5 focuses on lock the original source. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. call S.getReader() after successful postMessage and capture the TypeError. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for lock the original source is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. inspect S.locked before and after the transfer call. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: locked does not mean errored or closed; it describes exclusive reader ownership. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. assert the exception class without inventing a new terminal state. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of lock the original source should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 6 OF 12 · Change one premise

6. Reconstruct the destination readable

Back to contents

The short answer is that the receiving steps create a new readable backed by cross-realm pull, cancel and message algorithms. Chapter 6 focuses on reconstruct the destination readable. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. receive D, acquire reader RD and issue the first read. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for reconstruct the destination readable is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. receive the same transferred representation in a realm where no read is issued yet. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: D is a new platform object and does not preserve custom properties attached to S. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. record D identity, D.locked, RD identity and the first pending read. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of reconstruct the destination readable should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 7 OF 12 · Change one premise

7. Read chunks in destination order

Back to contents

The short answer is that destination demand allows A and then B to traverse the pipe without turning the transfer into two independent producers. Chapter 7 focuses on read chunks in destination order. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. resolve RD.read() with A, request again and resolve with B. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for read chunks in destination order is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. delay B at the source and keep the second destination read pending. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: message scheduling can delay observations but must not be described as reordering the stream contract. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. number pull, write, chunk message, enqueue and read fulfilment events. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of read chunks in destination order should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 8 OF 12 · Change one premise

8. Preserve backpressure across the realm boundary

Back to contents

The short answer is that the receiving readable uses demand messages so the origin-side internal writable does not run freely ahead of demand. Chapter 8 focuses on preserve backpressure across the realm boundary. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. pause RD after A and observe the origin-side write path waiting for the next pull message. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for preserve backpressure across the realm boundary is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. issue two reads promptly and compare how demand becomes available sooner. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: backpressure bounds coordination in this pipe but is not a network bandwidth guarantee. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. track backpressure-promise identity and when each write is allowed to proceed. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of preserve backpressure across the realm boundary should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 9 OF 12 · Handle limits and failures

9. Propagate ordinary close

Back to contents

The short answer is that closing S lets the pipe send a close message so D eventually reads done true after prior chunks. Chapter 9 focuses on propagate ordinary close. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. enqueue A, close S and trace A before destination completion. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for propagate ordinary close is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. close S before any chunk and show the first destination read completes with done true. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: ordinary close must not be rewritten as cancellation or producer error. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. assert final read result and both sides’ closed promises. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of propagate ordinary close should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 10 OF 12 · Handle limits and failures

10. Propagate producer error

Back to contents

The short answer is that erroring S causes the cross-realm writable path to send an error representation and D to become errored. Chapter 10 focuses on propagate producer error. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. after A is consumed, error S with E and capture the next destination read rejection. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for propagate producer error is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. error before any chunk and compare the absence of a fulfilled value. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: serialized error transport may alter object identity across realms even when the reason is represented. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. record source reason, posted error data and destination rejection evidence. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of propagate producer error should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 11 OF 12 · Verify and explain

11. Route destination cancellation

Back to contents

The short answer is that cancelling D propagates through the cross-realm readable and pipe toward cancellation of the original source. Chapter 11 focuses on route destination cancellation. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. read A, cancel D with reason stop and inspect the source cancel callback. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for route destination cancellation is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. close S normally instead and verify no cancellation callback is needed. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: application cleanup beyond the stream cancel algorithm remains host and source specific. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. log cancel call, reason representation, source callback and pipe settlement. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of route destination cancellation should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Next chapter

CHAPTER 12 OF 12 · Verify and explain

12. Build a transfer receipt

Back to contents

The short answer is that a complete receipt joins eligibility, source locking, destination capability, ordered chunks and terminal propagation without calling the transfer a copy. Chapter 12 focuses on build a transfer receipt. Begin with keep source stream identity, source lock, pipe promise, internal cross-realm writable, port identity, destination readable, chunk order, demand signal and terminal reason in separate columns. Writing those facts first prevents a familiar label or final summary value from replacing the mechanism or measurement basis that actually decides the result.

Worked example. run unlocked S through A, B and close while checking both realms. Treat every stated value as part of a controlled teaching fixture. Record the starting state before the operation, then record each conversion, selection, calculation, check or state transition in order. If a prerequisite fails, stop the trace there rather than inferring later effects from the usual path.

A useful first-principles question for build a transfer receipt is: what must already be true before this step can run? Use the rule above to separate the input contract from the result. Follow object identity, state and returned value independently. Two branches can print similar data while differing in ownership, timing, brand or future capability.

Now change exactly one premise. change only the precondition to locked and predict DataCloneError before any destination exists. Recalculate the trace from the changed fact rather than editing the old conclusion. Name the earliest event that differs, carry that difference through the remaining steps, and say which observations stay the same because their prerequisites did not change.

The main limit is this: the receipt proves the stream handoff contract rather than successful application processing. Keep language semantics separate from processor strategy, host scheduling, browser support, trust policy and the meaning assigned by an application. A focused example can establish the stated mechanism without pretending to settle those broader questions.

Practical evidence check. verify every chunk appears once, the source cannot acquire a reader and the destination settles once. Capture the reported values and failure conditions, but also preserve the calculation or event trail that led to them. A check that asserts only the last number or label can pass even when an earlier selection, conversion, grouping, state change or measurement basis was wrong.

A concise final explanation of build a transfer receipt should state the starting state, the governing rule, the ordered outcome and one boundary. It should not depend on a screenshot, one software message or an unstated assumption. That form is short enough for revision and precise enough for a reproducible technical note.

Contents · Previous chapter · Return to the Websites subject guide

Frequently asked questions

Is the original readable copied?

No. Transfer creates cross-realm piping and a new destination readable; it does not make two independent queues.

Why is the original locked?

The transfer machinery pipes from it and holds the reader needed by pipeTo.

Can the receiving realm read normally?

Yes. It receives a reconstructed ReadableStream and can acquire its own reader.

What if the source was already locked?

Transfer fails with DataCloneError before a usable destination is created.

Does backpressure still matter?

Yes. Pull messages coordinate demand across the realm boundary.

What should a test record?

Eligibility, source lock, port messages, destination reads and the terminal outcome.

Authoritative sources and evidence checks

WHATWG Streams Living Standard · WHATWG Streams — ReadableStream transfer steps · WHATWG Streams — transferring streams · WHATWG Streams source repository

The normative mechanism follows the WHATWG Streams Living Standard, last updated 25 October 2026 when checked for this article. The streams, chunks, ports, promise ledgers and failure cases are original teaching fixtures. They establish the specified stream behavior; they do not claim network delivery, worker availability, storage durability or application acceptance.