When a learner can reproduce a familiar example but a small variation causes confusion, the problem is usually an incomplete model rather than a lack of effort. The fastest useful response is to expose the hidden state and test one boundary at a time.
JavaScript BroadcastChannel provides a small publish-and-receive mechanism for eligible windows and workers that share the same storage key and channel name. A sender posts structured data to other matching channel objects; the source object does not receive its own message. Mastery means distinguishing a transient notification bus from persistent state, designing versioned idempotent messages, respecting storage partition and lifecycle boundaries, closing channels deliberately, and moving to SharedWorker, server messaging or durable storage when coordination becomes more demanding. This guide begins with that mechanism, then develops it through worked traces, deliberate mistakes, explained practice and transfer decisions.
The aim is independent reasoning. A learner should be able to predict behaviour, locate the earliest wrong assumption, use a safe diagnostic procedure and defend a design choice in a new project.
Punggol families can use the guide in short sessions around homework, CCAs and rest. The activities are proposed learning exercises, not claims about a physical branch, timetable, class size, fee, school relationship or guaranteed result.
Use disposable data and repositories, preserve backups, and check version-sensitive details against the official source. Current documentation settles a technical contract; observation and explanation turn that contract into usable knowledge.
Find your next learning step
Choose the route that matches the present difficulty. Use the complete index for a systematic course.
Build the model
Chapters 1-4 . Begin here, then continue after the learner can predict, verify and explain.
Use the core tools
Chapters 5-8 . Begin here, then continue after the learner can predict, verify and explain.
Handle boundaries
Chapters 9-12 . Begin here, then continue after the learner can predict, verify and explain.
Debug and verify
Chapters 13-16 . Begin here, then continue after the learner can predict, verify and explain.
Transfer with judgment
Chapters 17-20 . Begin here, then continue after the learner can predict, verify and explain.
Open the full chapter index . Jump to capstone practice . Use the How Studying Works hub . Read the official documentation
Complete chapter index
Chapters 1-4 . Build the model
Chapters 5-8 . Use the core tools
Chapters 9-12 . Handle boundaries
Chapters 13-16 . Debug and verify
new BroadcastChannel(name) creates an EventTarget associated with that exact channel name. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is treating similar names or case variants as one topic. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Centralise the channel constant and assert the name property in every context.
For the A name opens a broadcast channel chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on treating similar names or case variants as one topic. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const CHANNEL='study-board:v1';
const bus=new BroadcastChannel(CHANNEL);Explained result. bus.name is the exact constructor string and only matching channel names are candidate destinations. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework tabs. Predict the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “new BroadcastChannel(name) creates an EventTarget associated with that exact channel name.” Apply this procedure: Centralise the channel constant and assert the name property in every context. The expected mechanism is: bus.name is the exact constructor string and only matching channel names are candidate destinations. For the homework tabs, add one near-miss that exposes treating similar names or case variants as one topic. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library dashboard. Contrast the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “new BroadcastChannel(name) creates an EventTarget associated with that exact channel name.” Apply this procedure: Centralise the channel constant and assert the name property in every context. The expected mechanism is: bus.name is the exact constructor string and only matching channel names are candidate destinations. For the library dashboard, add one near-miss that exposes treating similar names or case variants as one topic. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: CCA planner. Stress-test the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “new BroadcastChannel(name) creates an EventTarget associated with that exact channel name.” Apply this procedure: Centralise the channel constant and assert the name property in every context. The expected mechanism is: bus.name is the exact constructor string and only matching channel names are candidate destinations. For the CCA planner, add one near-miss that exposes treating similar names or case variants as one topic. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: science viewer. Explain the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “new BroadcastChannel(name) creates an EventTarget associated with that exact channel name.” Apply this procedure: Centralise the channel constant and assert the name property in every context. The expected mechanism is: bus.name is the exact constructor string and only matching channel names are candidate destinations. For the science viewer, add one near-miss that exposes treating similar names or case variants as one topic. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers treating similar names or case variants as one topic.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Centralise the channel constant and assert the name property in every context.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from A name opens a broadcast channel?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing treating similar names or case variants as one topic be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny family calendar with an invalidation message telling every view to reread durable state. Include one ordinary case, one boundary and one deliberate failure caused by treating similar names or case variants as one topic. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: new BroadcastChannel(name) creates an EventTarget associated with that exact channel name. It shows a trace, not only a final value. The ordinary case should demonstrate “bus.name is the exact constructor string and only matching channel names are candidate destinations.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Centralise the channel constant and assert the name property in every context. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For A name opens a broadcast channel, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
destinations must be eligible, have an equal storage key and use the same channel name. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is describing BroadcastChannel as a universal cross-site bus. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Test same-site top-level contexts and an intentionally partitioned or different-origin case separately.
For the Storage key and name define the audience chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on describing BroadcastChannel as a universal cross-site bus. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const bus=new BroadcastChannel('auth:v1');Explained result. Only matching contexts inside the applicable storage partition can receive its broadcasts. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: CCA planner. Contrast the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “destinations must be eligible, have an equal storage key and use the same channel name.” Apply this procedure: Test same-site top-level contexts and an intentionally partitioned or different-origin case separately. The expected mechanism is: Only matching contexts inside the applicable storage partition can receive its broadcasts. For the CCA planner, add one near-miss that exposes describing BroadcastChannel as a universal cross-site bus. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: science viewer. Stress-test the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “destinations must be eligible, have an equal storage key and use the same channel name.” Apply this procedure: Test same-site top-level contexts and an intentionally partitioned or different-origin case separately. The expected mechanism is: Only matching contexts inside the applicable storage partition can receive its broadcasts. For the science viewer, add one near-miss that exposes describing BroadcastChannel as a universal cross-site bus. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision timer. Explain the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “destinations must be eligible, have an equal storage key and use the same channel name.” Apply this procedure: Test same-site top-level contexts and an intentionally partitioned or different-origin case separately. The expected mechanism is: Only matching contexts inside the applicable storage partition can receive its broadcasts. For the revision timer, add one near-miss that exposes describing BroadcastChannel as a universal cross-site bus. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: family calendar. Transfer the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “destinations must be eligible, have an equal storage key and use the same channel name.” Apply this procedure: Test same-site top-level contexts and an intentionally partitioned or different-origin case separately. The expected mechanism is: Only matching contexts inside the applicable storage partition can receive its broadcasts. For the family calendar, add one near-miss that exposes describing BroadcastChannel as a universal cross-site bus. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers describing BroadcastChannel as a universal cross-site bus.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Test same-site top-level contexts and an intentionally partitioned or different-origin case separately.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Storage key and name define the audience?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing describing BroadcastChannel as a universal cross-site bus be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny protocol laboratory with duplicate, delayed and malformed envelopes handled safely. Include one ordinary case, one boundary and one deliberate failure caused by describing BroadcastChannel as a universal cross-site bus. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: destinations must be eligible, have an equal storage key and use the same channel name. It shows a trace, not only a final value. The ordinary case should demonstrate “Only matching contexts inside the applicable storage partition can receive its broadcasts.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Test same-site top-level contexts and an intentionally partitioned or different-origin case separately. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Storage key and name define the audience, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
the postMessage algorithm removes the sending BroadcastChannel object from the destination list. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is waiting for the sender’s own message handler to commit local state. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Update local state directly and broadcast an invalidation or event to peers.
For the The source object does not receive its own post chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on waiting for the sender’s own message handler to commit local state. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
state.loggedOut=true;
bus.postMessage({type:'logout'});Explained result. Other matching channel objects may receive the event; this exact source object will not echo it to itself. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision timer. Stress-test the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the postMessage algorithm removes the sending BroadcastChannel object from the destination list.” Apply this procedure: Update local state directly and broadcast an invalidation or event to peers. The expected mechanism is: Other matching channel objects may receive the event; this exact source object will not echo it to itself. For the revision timer, add one near-miss that exposes waiting for the sender’s own message handler to commit local state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: family calendar. Explain the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the postMessage algorithm removes the sending BroadcastChannel object from the destination list.” Apply this procedure: Update local state directly and broadcast an invalidation or event to peers. The expected mechanism is: Other matching channel objects may receive the event; this exact source object will not echo it to itself. For the family calendar, add one near-miss that exposes waiting for the sender’s own message handler to commit local state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: protocol laboratory. Transfer the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the postMessage algorithm removes the sending BroadcastChannel object from the destination list.” Apply this procedure: Update local state directly and broadcast an invalidation or event to peers. The expected mechanism is: Other matching channel objects may receive the event; this exact source object will not echo it to itself. For the protocol laboratory, add one near-miss that exposes waiting for the sender’s own message handler to commit local state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: lifecycle fixture. Predict the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the postMessage algorithm removes the sending BroadcastChannel object from the destination list.” Apply this procedure: Update local state directly and broadcast an invalidation or event to peers. The expected mechanism is: Other matching channel objects may receive the event; this exact source object will not echo it to itself. For the lifecycle fixture, add one near-miss that exposes waiting for the sender’s own message handler to commit local state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers waiting for the sender’s own message handler to commit local state.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Update local state directly and broadcast an invalidation or event to peers.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from The source object does not receive its own post?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing waiting for the sender’s own message handler to commit local state be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny lifecycle fixture with channels opened, messaged, closed and released explicitly. Include one ordinary case, one boundary and one deliberate failure caused by waiting for the sender’s own message handler to commit local state. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: the postMessage algorithm removes the sending BroadcastChannel object from the destination list. It shows a trace, not only a final value. The ordinary case should demonstrate “Other matching channel objects may receive the event; this exact source object will not echo it to itself.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Update local state directly and broadcast an invalidation or event to peers. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For The source object does not receive its own post, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
postMessage serializes supported structured data, so nested arrays, objects and cloneable built-ins can cross the channel without JSON text. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is expecting functions, DOM nodes or arbitrary host objects to transfer. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Define a plain-data envelope and run unsupported values through a small failure fixture.
For the Messages use structured serialization chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on expecting functions, DOM nodes or arbitrary host objects to transfer. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
bus.postMessage({type:'task-done',id:'m12',at:Date.now()});Explained result. A receiving event obtains a structured clone of the supported envelope rather than the sender’s object identity. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: protocol laboratory. Explain the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “postMessage serializes supported structured data, so nested arrays, objects and cloneable built-ins can cross the channel without JSON text.” Apply this procedure: Define a plain-data envelope and run unsupported values through a small failure fixture. The expected mechanism is: A receiving event obtains a structured clone of the supported envelope rather than the sender’s object identity. For the protocol laboratory, add one near-miss that exposes expecting functions, DOM nodes or arbitrary host objects to transfer. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: lifecycle fixture. Transfer the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “postMessage serializes supported structured data, so nested arrays, objects and cloneable built-ins can cross the channel without JSON text.” Apply this procedure: Define a plain-data envelope and run unsupported values through a small failure fixture. The expected mechanism is: A receiving event obtains a structured clone of the supported envelope rather than the sender’s object identity. For the lifecycle fixture, add one near-miss that exposes expecting functions, DOM nodes or arbitrary host objects to transfer. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework tabs. Predict the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “postMessage serializes supported structured data, so nested arrays, objects and cloneable built-ins can cross the channel without JSON text.” Apply this procedure: Define a plain-data envelope and run unsupported values through a small failure fixture. The expected mechanism is: A receiving event obtains a structured clone of the supported envelope rather than the sender’s object identity. For the homework tabs, add one near-miss that exposes expecting functions, DOM nodes or arbitrary host objects to transfer. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library dashboard. Contrast the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “postMessage serializes supported structured data, so nested arrays, objects and cloneable built-ins can cross the channel without JSON text.” Apply this procedure: Define a plain-data envelope and run unsupported values through a small failure fixture. The expected mechanism is: A receiving event obtains a structured clone of the supported envelope rather than the sender’s object identity. For the library dashboard, add one near-miss that exposes expecting functions, DOM nodes or arbitrary host objects to transfer. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers expecting functions, DOM nodes or arbitrary host objects to transfer.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Define a plain-data envelope and run unsupported values through a small failure fixture.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Messages use structured serialization?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting functions, DOM nodes or arbitrary host objects to transfer be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework tabs with a task completion notice reflected in two open study-board tabs. Include one ordinary case, one boundary and one deliberate failure caused by expecting functions, DOM nodes or arbitrary host objects to transfer. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: postMessage serializes supported structured data, so nested arrays, objects and cloneable built-ins can cross the channel without JSON text. It shows a trace, not only a final value. The ordinary case should demonstrate “A receiving event obtains a structured clone of the supported envelope rather than the sender’s object identity.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Define a plain-data envelope and run unsupported values through a small failure fixture. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Messages use structured serialization, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
an uncloneable payload causes structured serialization to throw rather than silently removing the bad member. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is wrapping every post in a broad catch and losing the schema defect. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Validate the envelope and catch only where the caller can repair or report the payload.
For the Serialization failure happens at send time chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on wrapping every post in a broad catch and losing the schema defect. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
try{ bus.postMessage({run(){}}) }catch(error){ console.error(error.name) }Explained result. The function value cannot be structured-serialized, so the sender observes an exception instead of a partial message. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework tabs. Transfer the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an uncloneable payload causes structured serialization to throw rather than silently removing the bad member.” Apply this procedure: Validate the envelope and catch only where the caller can repair or report the payload. The expected mechanism is: The function value cannot be structured-serialized, so the sender observes an exception instead of a partial message. For the homework tabs, add one near-miss that exposes wrapping every post in a broad catch and losing the schema defect. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library dashboard. Predict the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an uncloneable payload causes structured serialization to throw rather than silently removing the bad member.” Apply this procedure: Validate the envelope and catch only where the caller can repair or report the payload. The expected mechanism is: The function value cannot be structured-serialized, so the sender observes an exception instead of a partial message. For the library dashboard, add one near-miss that exposes wrapping every post in a broad catch and losing the schema defect. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: CCA planner. Contrast the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an uncloneable payload causes structured serialization to throw rather than silently removing the bad member.” Apply this procedure: Validate the envelope and catch only where the caller can repair or report the payload. The expected mechanism is: The function value cannot be structured-serialized, so the sender observes an exception instead of a partial message. For the CCA planner, add one near-miss that exposes wrapping every post in a broad catch and losing the schema defect. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: science viewer. Stress-test the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an uncloneable payload causes structured serialization to throw rather than silently removing the bad member.” Apply this procedure: Validate the envelope and catch only where the caller can repair or report the payload. The expected mechanism is: The function value cannot be structured-serialized, so the sender observes an exception instead of a partial message. For the science viewer, add one near-miss that exposes wrapping every post in a broad catch and losing the schema defect. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers wrapping every post in a broad catch and losing the schema defect.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Validate the envelope and catch only where the caller can repair or report the payload.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Serialization failure happens at send time?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing wrapping every post in a broad catch and losing the schema defect be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library dashboard with a sign-out event propagated to unrelated catalogue windows. Include one ordinary case, one boundary and one deliberate failure caused by wrapping every post in a broad catch and losing the schema defect. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: an uncloneable payload causes structured serialization to throw rather than silently removing the bad member. It shows a trace, not only a final value. The ordinary case should demonstrate “The function value cannot be structured-serialized, so the sender observes an exception instead of a partial message.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Validate the envelope and catch only where the caller can repair or report the payload. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Serialization failure happens at send time, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
a receiving channel handles message events and reads the cloned payload from event.data. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is reading global mutable state instead of the delivered versioned envelope. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Attach one handler, validate event.data and route by a documented type field.
For the Message events carry peer data chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on reading global mutable state instead of the delivered versioned envelope. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
bus.addEventListener('message',event=>handle(event.data));Explained result. The handler receives a MessageEvent for data posted by another matching eligible channel object. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: CCA planner. Predict the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a receiving channel handles message events and reads the cloned payload from event.data.” Apply this procedure: Attach one handler, validate event.data and route by a documented type field. The expected mechanism is: The handler receives a MessageEvent for data posted by another matching eligible channel object. For the CCA planner, add one near-miss that exposes reading global mutable state instead of the delivered versioned envelope. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: science viewer. Contrast the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a receiving channel handles message events and reads the cloned payload from event.data.” Apply this procedure: Attach one handler, validate event.data and route by a documented type field. The expected mechanism is: The handler receives a MessageEvent for data posted by another matching eligible channel object. For the science viewer, add one near-miss that exposes reading global mutable state instead of the delivered versioned envelope. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision timer. Stress-test the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a receiving channel handles message events and reads the cloned payload from event.data.” Apply this procedure: Attach one handler, validate event.data and route by a documented type field. The expected mechanism is: The handler receives a MessageEvent for data posted by another matching eligible channel object. For the revision timer, add one near-miss that exposes reading global mutable state instead of the delivered versioned envelope. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: family calendar. Explain the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a receiving channel handles message events and reads the cloned payload from event.data.” Apply this procedure: Attach one handler, validate event.data and route by a documented type field. The expected mechanism is: The handler receives a MessageEvent for data posted by another matching eligible channel object. For the family calendar, add one near-miss that exposes reading global mutable state instead of the delivered versioned envelope. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers reading global mutable state instead of the delivered versioned envelope.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Attach one handler, validate event.data and route by a documented type field.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Message events carry peer data?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing reading global mutable state instead of the delivered versioned envelope be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny CCA planner with filter and refresh hints shared without copying the database. Include one ordinary case, one boundary and one deliberate failure caused by reading global mutable state instead of the delivered versioned envelope. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: a receiving channel handles message events and reads the cloned payload from event.data. It shows a trace, not only a final value. The ordinary case should demonstrate “The handler receives a MessageEvent for data posted by another matching eligible channel object.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Attach one handler, validate event.data and route by a documented type field. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Message events carry peer data, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
BroadcastChannel supports a messageerror event for cases where delivered data cannot be deserialized in the destination context. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is assuming every send that serialized will be usable by every destination environment. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Record messageerror separately from application-level validation errors.
For the messageerror exposes deserialization failure chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on assuming every send that serialized will be usable by every destination environment. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
bus.addEventListener('messageerror',event=>report(event));Explained result. The error route is observable and should not be confused with an unknown application message type. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision timer. Contrast the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel supports a messageerror event for cases where delivered data cannot be deserialized in the destination context.” Apply this procedure: Record messageerror separately from application-level validation errors. The expected mechanism is: The error route is observable and should not be confused with an unknown application message type. For the revision timer, add one near-miss that exposes assuming every send that serialized will be usable by every destination environment. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: family calendar. Stress-test the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel supports a messageerror event for cases where delivered data cannot be deserialized in the destination context.” Apply this procedure: Record messageerror separately from application-level validation errors. The expected mechanism is: The error route is observable and should not be confused with an unknown application message type. For the family calendar, add one near-miss that exposes assuming every send that serialized will be usable by every destination environment. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: protocol laboratory. Explain the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel supports a messageerror event for cases where delivered data cannot be deserialized in the destination context.” Apply this procedure: Record messageerror separately from application-level validation errors. The expected mechanism is: The error route is observable and should not be confused with an unknown application message type. For the protocol laboratory, add one near-miss that exposes assuming every send that serialized will be usable by every destination environment. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: lifecycle fixture. Transfer the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel supports a messageerror event for cases where delivered data cannot be deserialized in the destination context.” Apply this procedure: Record messageerror separately from application-level validation errors. The expected mechanism is: The error route is observable and should not be confused with an unknown application message type. For the lifecycle fixture, add one near-miss that exposes assuming every send that serialized will be usable by every destination environment. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers assuming every send that serialized will be usable by every destination environment.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Record messageerror separately from application-level validation errors.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from messageerror exposes deserialization failure?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming every send that serialized will be usable by every destination environment be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science viewer with a dataset-version notice sent from a worker to visible pages. Include one ordinary case, one boundary and one deliberate failure caused by assuming every send that serialized will be usable by every destination environment. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: BroadcastChannel supports a messageerror event for cases where delivered data cannot be deserialized in the destination context. It shows a trace, not only a final value. The ordinary case should demonstrate “The error route is observable and should not be confused with an unknown application message type.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Record messageerror separately from application-level validation errors. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For messageerror exposes deserialization failure, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
the API sends events to currently eligible matching channel objects and supplies no replay log for a context opened later. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using the channel as the only record of completed homework or authentication state. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Persist authoritative state elsewhere and broadcast only a hint to reread it.
For the Broadcasts are transient, not a history chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using the channel as the only record of completed homework or authentication state. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
localStorage.setItem('revisionVersion','42');
bus.postMessage({type:'invalidate',version:42});Explained result. A late tab can recover version 42 from storage even though it missed the earlier broadcast. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: protocol laboratory. Stress-test the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the API sends events to currently eligible matching channel objects and supplies no replay log for a context opened later.” Apply this procedure: Persist authoritative state elsewhere and broadcast only a hint to reread it. The expected mechanism is: A late tab can recover version 42 from storage even though it missed the earlier broadcast. For the protocol laboratory, add one near-miss that exposes using the channel as the only record of completed homework or authentication state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: lifecycle fixture. Explain the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the API sends events to currently eligible matching channel objects and supplies no replay log for a context opened later.” Apply this procedure: Persist authoritative state elsewhere and broadcast only a hint to reread it. The expected mechanism is: A late tab can recover version 42 from storage even though it missed the earlier broadcast. For the lifecycle fixture, add one near-miss that exposes using the channel as the only record of completed homework or authentication state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework tabs. Transfer the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the API sends events to currently eligible matching channel objects and supplies no replay log for a context opened later.” Apply this procedure: Persist authoritative state elsewhere and broadcast only a hint to reread it. The expected mechanism is: A late tab can recover version 42 from storage even though it missed the earlier broadcast. For the homework tabs, add one near-miss that exposes using the channel as the only record of completed homework or authentication state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library dashboard. Predict the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the API sends events to currently eligible matching channel objects and supplies no replay log for a context opened later.” Apply this procedure: Persist authoritative state elsewhere and broadcast only a hint to reread it. The expected mechanism is: A late tab can recover version 42 from storage even though it missed the earlier broadcast. For the library dashboard, add one near-miss that exposes using the channel as the only record of completed homework or authentication state. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using the channel as the only record of completed homework or authentication state.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Persist authoritative state elsewhere and broadcast only a hint to reread it.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Broadcasts are transient, not a history?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using the channel as the only record of completed homework or authentication state be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny revision timer with start and stop intentions coordinated across tabs. Include one ordinary case, one boundary and one deliberate failure caused by using the channel as the only record of completed homework or authentication state. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: the API sends events to currently eligible matching channel objects and supplies no replay log for a context opened later. It shows a trace, not only a final value. The ordinary case should demonstrate “A late tab can recover version 42 from storage even though it missed the earlier broadcast.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Persist authoritative state elsewhere and broadcast only a hint to reread it. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Broadcasts are transient, not a history, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
the specification constrains creation order for destinations sharing an agent but does not define one complete ordering across all agents. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is treating arrival order as a distributed transaction log. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Include monotonic versions or timestamps from the authoritative state and ignore stale updates.
For the There is no global total-order promise chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on treating arrival order as a distributed transaction log. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
if(message.version>seenVersion) refresh(message.version);Explained result. Application correctness comes from version comparison, not an assumed universal arrival order. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework tabs. Explain the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the specification constrains creation order for destinations sharing an agent but does not define one complete ordering across all agents.” Apply this procedure: Include monotonic versions or timestamps from the authoritative state and ignore stale updates. The expected mechanism is: Application correctness comes from version comparison, not an assumed universal arrival order. For the homework tabs, add one near-miss that exposes treating arrival order as a distributed transaction log. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library dashboard. Transfer the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the specification constrains creation order for destinations sharing an agent but does not define one complete ordering across all agents.” Apply this procedure: Include monotonic versions or timestamps from the authoritative state and ignore stale updates. The expected mechanism is: Application correctness comes from version comparison, not an assumed universal arrival order. For the library dashboard, add one near-miss that exposes treating arrival order as a distributed transaction log. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: CCA planner. Predict the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the specification constrains creation order for destinations sharing an agent but does not define one complete ordering across all agents.” Apply this procedure: Include monotonic versions or timestamps from the authoritative state and ignore stale updates. The expected mechanism is: Application correctness comes from version comparison, not an assumed universal arrival order. For the CCA planner, add one near-miss that exposes treating arrival order as a distributed transaction log. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: science viewer. Contrast the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “the specification constrains creation order for destinations sharing an agent but does not define one complete ordering across all agents.” Apply this procedure: Include monotonic versions or timestamps from the authoritative state and ignore stale updates. The expected mechanism is: Application correctness comes from version comparison, not an assumed universal arrival order. For the science viewer, add one near-miss that exposes treating arrival order as a distributed transaction log. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers treating arrival order as a distributed transaction log.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Include monotonic versions or timestamps from the authoritative state and ignore stale updates.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from There is no global total-order promise?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing treating arrival order as a distributed transaction log be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny family calendar with an invalidation message telling every view to reread durable state. Include one ordinary case, one boundary and one deliberate failure caused by treating arrival order as a distributed transaction log. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: the specification constrains creation order for destinations sharing an agent but does not define one complete ordering across all agents. It shows a trace, not only a final value. The ordinary case should demonstrate “Application correctness comes from version comparison, not an assumed universal arrival order.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Include monotonic versions or timestamps from the authoritative state and ignore stale updates. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For There is no global total-order promise, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 10 OF 20 . Handle boundaries
10. Eligibility follows document and worker lifecycle
a window must have a fully active document, while a worker must not be closing or suspendable, to be eligible for messaging. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is expecting a discarded or frozen context to process every event. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Treat resumption as a state-reconciliation moment and reread durable truth.
For the Eligibility follows document and worker lifecycle chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on expecting a discarded or frozen context to process every event. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
document.addEventListener('visibilitychange',()=>{ if(!document.hidden) refresh(); });Explained result. The visible context repairs possible gaps instead of assuming continuous eligibility. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: CCA planner. Transfer the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a window must have a fully active document, while a worker must not be closing or suspendable, to be eligible for messaging.” Apply this procedure: Treat resumption as a state-reconciliation moment and reread durable truth. The expected mechanism is: The visible context repairs possible gaps instead of assuming continuous eligibility. For the CCA planner, add one near-miss that exposes expecting a discarded or frozen context to process every event. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: science viewer. Predict the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a window must have a fully active document, while a worker must not be closing or suspendable, to be eligible for messaging.” Apply this procedure: Treat resumption as a state-reconciliation moment and reread durable truth. The expected mechanism is: The visible context repairs possible gaps instead of assuming continuous eligibility. For the science viewer, add one near-miss that exposes expecting a discarded or frozen context to process every event. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision timer. Contrast the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a window must have a fully active document, while a worker must not be closing or suspendable, to be eligible for messaging.” Apply this procedure: Treat resumption as a state-reconciliation moment and reread durable truth. The expected mechanism is: The visible context repairs possible gaps instead of assuming continuous eligibility. For the revision timer, add one near-miss that exposes expecting a discarded or frozen context to process every event. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: family calendar. Stress-test the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a window must have a fully active document, while a worker must not be closing or suspendable, to be eligible for messaging.” Apply this procedure: Treat resumption as a state-reconciliation moment and reread durable truth. The expected mechanism is: The visible context repairs possible gaps instead of assuming continuous eligibility. For the family calendar, add one near-miss that exposes expecting a discarded or frozen context to process every event. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers expecting a discarded or frozen context to process every event.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Treat resumption as a state-reconciliation moment and reread durable truth.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Eligibility follows document and worker lifecycle?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting a discarded or frozen context to process every event be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny protocol laboratory with duplicate, delayed and malformed envelopes handled safely. Include one ordinary case, one boundary and one deliberate failure caused by expecting a discarded or frozen context to process every event. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: a window must have a fully active document, while a worker must not be closing or suspendable, to be eligible for messaging. It shows a trace, not only a final value. The ordinary case should demonstrate “The visible context repairs possible gaps instead of assuming continuous eligibility.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Treat resumption as a state-reconciliation moment and reread durable truth. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Eligibility follows document and worker lifecycle, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 11 OF 20 . Handle boundaries
11. Storage partitioning can separate same-origin contexts
matching origin alone is insufficient when storage keys differ under browser partitioning rules. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is debugging a partition boundary as a spelling error in the channel name. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Log origin, top-level context and the durable fallback path without weakening isolation.
For the Storage partitioning can separate same-origin contexts chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on debugging a partition boundary as a spelling error in the channel name. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
console.table({origin:location.origin,channel:bus.name});Explained result. The diagnostic identifies context facts, while the design still tolerates peers that cannot share a storage key. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision timer. Predict the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “matching origin alone is insufficient when storage keys differ under browser partitioning rules.” Apply this procedure: Log origin, top-level context and the durable fallback path without weakening isolation. The expected mechanism is: The diagnostic identifies context facts, while the design still tolerates peers that cannot share a storage key. For the revision timer, add one near-miss that exposes debugging a partition boundary as a spelling error in the channel name. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: family calendar. Contrast the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “matching origin alone is insufficient when storage keys differ under browser partitioning rules.” Apply this procedure: Log origin, top-level context and the durable fallback path without weakening isolation. The expected mechanism is: The diagnostic identifies context facts, while the design still tolerates peers that cannot share a storage key. For the family calendar, add one near-miss that exposes debugging a partition boundary as a spelling error in the channel name. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: protocol laboratory. Stress-test the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “matching origin alone is insufficient when storage keys differ under browser partitioning rules.” Apply this procedure: Log origin, top-level context and the durable fallback path without weakening isolation. The expected mechanism is: The diagnostic identifies context facts, while the design still tolerates peers that cannot share a storage key. For the protocol laboratory, add one near-miss that exposes debugging a partition boundary as a spelling error in the channel name. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: lifecycle fixture. Explain the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “matching origin alone is insufficient when storage keys differ under browser partitioning rules.” Apply this procedure: Log origin, top-level context and the durable fallback path without weakening isolation. The expected mechanism is: The diagnostic identifies context facts, while the design still tolerates peers that cannot share a storage key. For the lifecycle fixture, add one near-miss that exposes debugging a partition boundary as a spelling error in the channel name. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers debugging a partition boundary as a spelling error in the channel name.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Log origin, top-level context and the durable fallback path without weakening isolation.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Storage partitioning can separate same-origin contexts?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing debugging a partition boundary as a spelling error in the channel name be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny lifecycle fixture with channels opened, messaged, closed and released explicitly. Include one ordinary case, one boundary and one deliberate failure caused by debugging a partition boundary as a spelling error in the channel name. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: matching origin alone is insufficient when storage keys differ under browser partitioning rules. It shows a trace, not only a final value. The ordinary case should demonstrate “The diagnostic identifies context facts, while the design still tolerates peers that cannot share a storage key.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Log origin, top-level context and the durable fallback path without weakening isolation. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Storage partitioning can separate same-origin contexts, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
BroadcastChannel is exposed to Window and eligible WorkerGlobalScope contexts. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is routing heavy work through a page merely because the channel began there. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Give the worker the same protocol version and test page-to-worker and worker-to-page flows.
For the Workers can join the same simple bus chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on routing heavy work through a page merely because the channel began there. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const bus=new BroadcastChannel('dataset:v1');
bus.postMessage({type:'ready'});Explained result. An eligible worker channel with the same storage key and name participates like another endpoint. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: protocol laboratory. Contrast the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel is exposed to Window and eligible WorkerGlobalScope contexts.” Apply this procedure: Give the worker the same protocol version and test page-to-worker and worker-to-page flows. The expected mechanism is: An eligible worker channel with the same storage key and name participates like another endpoint. For the protocol laboratory, add one near-miss that exposes routing heavy work through a page merely because the channel began there. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: lifecycle fixture. Stress-test the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel is exposed to Window and eligible WorkerGlobalScope contexts.” Apply this procedure: Give the worker the same protocol version and test page-to-worker and worker-to-page flows. The expected mechanism is: An eligible worker channel with the same storage key and name participates like another endpoint. For the lifecycle fixture, add one near-miss that exposes routing heavy work through a page merely because the channel began there. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework tabs. Explain the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel is exposed to Window and eligible WorkerGlobalScope contexts.” Apply this procedure: Give the worker the same protocol version and test page-to-worker and worker-to-page flows. The expected mechanism is: An eligible worker channel with the same storage key and name participates like another endpoint. For the homework tabs, add one near-miss that exposes routing heavy work through a page merely because the channel began there. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library dashboard. Transfer the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel is exposed to Window and eligible WorkerGlobalScope contexts.” Apply this procedure: Give the worker the same protocol version and test page-to-worker and worker-to-page flows. The expected mechanism is: An eligible worker channel with the same storage key and name participates like another endpoint. For the library dashboard, add one near-miss that exposes routing heavy work through a page merely because the channel began there. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers routing heavy work through a page merely because the channel began there.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Give the worker the same protocol version and test page-to-worker and worker-to-page flows.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Workers can join the same simple bus?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing routing heavy work through a page merely because the channel began there be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework tabs with a task completion notice reflected in two open study-board tabs. Include one ordinary case, one boundary and one deliberate failure caused by routing heavy work through a page merely because the channel began there. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: BroadcastChannel is exposed to Window and eligible WorkerGlobalScope contexts. It shows a trace, not only a final value. The ordinary case should demonstrate “An eligible worker channel with the same storage key and name participates like another endpoint.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Give the worker the same protocol version and test page-to-worker and worker-to-page flows. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Workers can join the same simple bus, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
close sets the object’s closed flag and lets it become collectable when no other references keep it alive. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is dropping a component reference while listeners keep an unclosed channel strongly reachable. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Pair construction and close in the same ownership unit.
For the close ends this channel object chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on dropping a component reference while listeners keep an unclosed channel strongly reachable. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const bus=new BroadcastChannel('planner:v1');
// teardown
bus.close();Explained result. After close, this object is no longer a live endpoint and postMessage on it raises InvalidStateError. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework tabs. Stress-test the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “close sets the object’s closed flag and lets it become collectable when no other references keep it alive.” Apply this procedure: Pair construction and close in the same ownership unit. The expected mechanism is: After close, this object is no longer a live endpoint and postMessage on it raises InvalidStateError. For the homework tabs, add one near-miss that exposes dropping a component reference while listeners keep an unclosed channel strongly reachable. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library dashboard. Explain the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “close sets the object’s closed flag and lets it become collectable when no other references keep it alive.” Apply this procedure: Pair construction and close in the same ownership unit. The expected mechanism is: After close, this object is no longer a live endpoint and postMessage on it raises InvalidStateError. For the library dashboard, add one near-miss that exposes dropping a component reference while listeners keep an unclosed channel strongly reachable. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: CCA planner. Transfer the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “close sets the object’s closed flag and lets it become collectable when no other references keep it alive.” Apply this procedure: Pair construction and close in the same ownership unit. The expected mechanism is: After close, this object is no longer a live endpoint and postMessage on it raises InvalidStateError. For the CCA planner, add one near-miss that exposes dropping a component reference while listeners keep an unclosed channel strongly reachable. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: science viewer. Predict the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “close sets the object’s closed flag and lets it become collectable when no other references keep it alive.” Apply this procedure: Pair construction and close in the same ownership unit. The expected mechanism is: After close, this object is no longer a live endpoint and postMessage on it raises InvalidStateError. For the science viewer, add one near-miss that exposes dropping a component reference while listeners keep an unclosed channel strongly reachable. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers dropping a component reference while listeners keep an unclosed channel strongly reachable.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Pair construction and close in the same ownership unit.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from close ends this channel object?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing dropping a component reference while listeners keep an unclosed channel strongly reachable be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library dashboard with a sign-out event propagated to unrelated catalogue windows. Include one ordinary case, one boundary and one deliberate failure caused by dropping a component reference while listeners keep an unclosed channel strongly reachable. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: close sets the object’s closed flag and lets it become collectable when no other references keep it alive. It shows a trace, not only a final value. The ordinary case should demonstrate “After close, this object is no longer a live endpoint and postMessage on it raises InvalidStateError.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Pair construction and close in the same ownership unit. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For close ends this channel object, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
an open channel with message or messageerror listeners is strongly referenced by its relevant global object. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is creating a new channel on every render and relying on garbage collection. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Create once per component owner, remove incidental listeners and close on teardown.
For the Listeners create a lifecycle responsibility chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on creating a new channel on every render and relying on garbage collection. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
function dispose(){ bus.removeEventListener('message',onMessage); bus.close(); }Explained result. Explicit cleanup prevents the apparent memory leak described by the platform specification. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: CCA planner. Explain the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an open channel with message or messageerror listeners is strongly referenced by its relevant global object.” Apply this procedure: Create once per component owner, remove incidental listeners and close on teardown. The expected mechanism is: Explicit cleanup prevents the apparent memory leak described by the platform specification. For the CCA planner, add one near-miss that exposes creating a new channel on every render and relying on garbage collection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: science viewer. Transfer the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an open channel with message or messageerror listeners is strongly referenced by its relevant global object.” Apply this procedure: Create once per component owner, remove incidental listeners and close on teardown. The expected mechanism is: Explicit cleanup prevents the apparent memory leak described by the platform specification. For the science viewer, add one near-miss that exposes creating a new channel on every render and relying on garbage collection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision timer. Predict the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an open channel with message or messageerror listeners is strongly referenced by its relevant global object.” Apply this procedure: Create once per component owner, remove incidental listeners and close on teardown. The expected mechanism is: Explicit cleanup prevents the apparent memory leak described by the platform specification. For the revision timer, add one near-miss that exposes creating a new channel on every render and relying on garbage collection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: family calendar. Contrast the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “an open channel with message or messageerror listeners is strongly referenced by its relevant global object.” Apply this procedure: Create once per component owner, remove incidental listeners and close on teardown. The expected mechanism is: Explicit cleanup prevents the apparent memory leak described by the platform specification. For the family calendar, add one near-miss that exposes creating a new channel on every render and relying on garbage collection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers creating a new channel on every render and relying on garbage collection.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Create once per component owner, remove incidental listeners and close on teardown.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Listeners create a lifecycle responsibility?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing creating a new channel on every render and relying on garbage collection be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny CCA planner with filter and refresh hints shared without copying the database. Include one ordinary case, one boundary and one deliberate failure caused by creating a new channel on every render and relying on garbage collection. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: an open channel with message or messageerror listeners is strongly referenced by its relevant global object. It shows a trace, not only a final value. The ordinary case should demonstrate “Explicit cleanup prevents the apparent memory leak described by the platform specification.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Create once per component owner, remove incidental listeners and close on teardown. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Listeners create a lifecycle responsibility, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
a message should declare protocol version, type, identifier and minimal payload so old and new tabs can coexist safely. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is changing the meaning of an existing type without a compatibility path. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Reject unknown versions, ignore unknown types safely and keep payloads small.
For the A versioned envelope protects evolution chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on changing the meaning of an existing type without a compatibility path. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
{version:1,type:'task-updated',id:'a17',revision:8}Explained result. The receiver can validate compatibility before applying or using the event as an invalidation hint. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision timer. Transfer the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a message should declare protocol version, type, identifier and minimal payload so old and new tabs can coexist safely.” Apply this procedure: Reject unknown versions, ignore unknown types safely and keep payloads small. The expected mechanism is: The receiver can validate compatibility before applying or using the event as an invalidation hint. For the revision timer, add one near-miss that exposes changing the meaning of an existing type without a compatibility path. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: family calendar. Predict the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a message should declare protocol version, type, identifier and minimal payload so old and new tabs can coexist safely.” Apply this procedure: Reject unknown versions, ignore unknown types safely and keep payloads small. The expected mechanism is: The receiver can validate compatibility before applying or using the event as an invalidation hint. For the family calendar, add one near-miss that exposes changing the meaning of an existing type without a compatibility path. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: protocol laboratory. Contrast the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a message should declare protocol version, type, identifier and minimal payload so old and new tabs can coexist safely.” Apply this procedure: Reject unknown versions, ignore unknown types safely and keep payloads small. The expected mechanism is: The receiver can validate compatibility before applying or using the event as an invalidation hint. For the protocol laboratory, add one near-miss that exposes changing the meaning of an existing type without a compatibility path. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: lifecycle fixture. Stress-test the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a message should declare protocol version, type, identifier and minimal payload so old and new tabs can coexist safely.” Apply this procedure: Reject unknown versions, ignore unknown types safely and keep payloads small. The expected mechanism is: The receiver can validate compatibility before applying or using the event as an invalidation hint. For the lifecycle fixture, add one near-miss that exposes changing the meaning of an existing type without a compatibility path. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers changing the meaning of an existing type without a compatibility path.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Reject unknown versions, ignore unknown types safely and keep payloads small.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from A versioned envelope protects evolution?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing changing the meaning of an existing type without a compatibility path be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science viewer with a dataset-version notice sent from a worker to visible pages. Include one ordinary case, one boundary and one deliberate failure caused by changing the meaning of an existing type without a compatibility path. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: a message should declare protocol version, type, identifier and minimal payload so old and new tabs can coexist safely. It shows a trace, not only a final value. The ordinary case should demonstrate “The receiver can validate compatibility before applying or using the event as an invalidation hint.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Reject unknown versions, ignore unknown types safely and keep payloads small. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For A versioned envelope protects evolution, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
application protocols should tolerate repeated or superseded messages even when the transport itself is simple. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is incrementing a counter twice merely because the same logical event is processed twice. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Attach event IDs or authoritative revisions and record the last applied value.
For the Idempotency protects duplicate effects chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on incrementing a counter twice merely because the same logical event is processed twice. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
if(seen.has(msg.eventId)) return;
seen.add(msg.eventId);Explained result. A duplicate logical event becomes a no-op while a newer revision still triggers reconciliation. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: protocol laboratory. Predict the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “application protocols should tolerate repeated or superseded messages even when the transport itself is simple.” Apply this procedure: Attach event IDs or authoritative revisions and record the last applied value. The expected mechanism is: A duplicate logical event becomes a no-op while a newer revision still triggers reconciliation. For the protocol laboratory, add one near-miss that exposes incrementing a counter twice merely because the same logical event is processed twice. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: lifecycle fixture. Contrast the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “application protocols should tolerate repeated or superseded messages even when the transport itself is simple.” Apply this procedure: Attach event IDs or authoritative revisions and record the last applied value. The expected mechanism is: A duplicate logical event becomes a no-op while a newer revision still triggers reconciliation. For the lifecycle fixture, add one near-miss that exposes incrementing a counter twice merely because the same logical event is processed twice. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework tabs. Stress-test the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “application protocols should tolerate repeated or superseded messages even when the transport itself is simple.” Apply this procedure: Attach event IDs or authoritative revisions and record the last applied value. The expected mechanism is: A duplicate logical event becomes a no-op while a newer revision still triggers reconciliation. For the homework tabs, add one near-miss that exposes incrementing a counter twice merely because the same logical event is processed twice. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library dashboard. Explain the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “application protocols should tolerate repeated or superseded messages even when the transport itself is simple.” Apply this procedure: Attach event IDs or authoritative revisions and record the last applied value. The expected mechanism is: A duplicate logical event becomes a no-op while a newer revision still triggers reconciliation. For the library dashboard, add one near-miss that exposes incrementing a counter twice merely because the same logical event is processed twice. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers incrementing a counter twice merely because the same logical event is processed twice.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Attach event IDs or authoritative revisions and record the last applied value.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Idempotency protects duplicate effects?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing incrementing a counter twice merely because the same logical event is processed twice be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny revision timer with start and stop intentions coordinated across tabs. Include one ordinary case, one boundary and one deliberate failure caused by incrementing a counter twice merely because the same logical event is processed twice. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: application protocols should tolerate repeated or superseded messages even when the transport itself is simple. It shows a trace, not only a final value. The ordinary case should demonstrate “A duplicate logical event becomes a no-op while a newer revision still triggers reconciliation.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Attach event IDs or authoritative revisions and record the last applied value. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Idempotency protects duplicate effects, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
BroadcastChannel carries notifications but does not itself provide durable locks, leader election or atomic multi-tab updates. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is electing a permanent leader from one hello message and assuming failures are detected. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Use Web Locks, SharedWorker or a server protocol when exclusivity and failure detection matter.
For the Coordination is not shared-state locking chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on electing a permanent leader from one hello message and assuming failures are detected. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
bus.postMessage({type:'refresh-request'});Explained result. The message asks peers to act; it does not reserve a resource or make their actions atomic. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework tabs. Contrast the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel carries notifications but does not itself provide durable locks, leader election or atomic multi-tab updates.” Apply this procedure: Use Web Locks, SharedWorker or a server protocol when exclusivity and failure detection matter. The expected mechanism is: The message asks peers to act; it does not reserve a resource or make their actions atomic. For the homework tabs, add one near-miss that exposes electing a permanent leader from one hello message and assuming failures are detected. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library dashboard. Stress-test the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel carries notifications but does not itself provide durable locks, leader election or atomic multi-tab updates.” Apply this procedure: Use Web Locks, SharedWorker or a server protocol when exclusivity and failure detection matter. The expected mechanism is: The message asks peers to act; it does not reserve a resource or make their actions atomic. For the library dashboard, add one near-miss that exposes electing a permanent leader from one hello message and assuming failures are detected. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: CCA planner. Explain the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel carries notifications but does not itself provide durable locks, leader election or atomic multi-tab updates.” Apply this procedure: Use Web Locks, SharedWorker or a server protocol when exclusivity and failure detection matter. The expected mechanism is: The message asks peers to act; it does not reserve a resource or make their actions atomic. For the CCA planner, add one near-miss that exposes electing a permanent leader from one hello message and assuming failures are detected. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: science viewer. Transfer the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel carries notifications but does not itself provide durable locks, leader election or atomic multi-tab updates.” Apply this procedure: Use Web Locks, SharedWorker or a server protocol when exclusivity and failure detection matter. The expected mechanism is: The message asks peers to act; it does not reserve a resource or make their actions atomic. For the science viewer, add one near-miss that exposes electing a permanent leader from one hello message and assuming failures are detected. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers electing a permanent leader from one hello message and assuming failures are detected.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Use Web Locks, SharedWorker or a server protocol when exclusivity and failure detection matter.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Coordination is not shared-state locking?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing electing a permanent leader from one hello message and assuming failures are detected be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny family calendar with an invalidation message telling every view to reread durable state. Include one ordinary case, one boundary and one deliberate failure caused by electing a permanent leader from one hello message and assuming failures are detected. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: BroadcastChannel carries notifications but does not itself provide durable locks, leader election or atomic multi-tab updates. It shows a trace, not only a final value. The ordinary case should demonstrate “The message asks peers to act; it does not reserve a resource or make their actions atomic.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Use Web Locks, SharedWorker or a server protocol when exclusivity and failure detection matter. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Coordination is not shared-state locking, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 18 OF 20 . Transfer with judgment
18. Same partition does not remove trust boundaries
any script running in a matching eligible context can use the agreed channel name, so payloads still need validation and least privilege. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is putting secrets in messages because the API is same-origin constrained. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Send identifiers or invalidations, validate every field and keep authorization on the authoritative service.
For the Same partition does not remove trust boundaries chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on putting secrets in messages because the API is same-origin constrained. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
if(!isTaskNotice(event.data)) return;Explained result. Schema validation rejects malformed messages without treating channel membership as authorization. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: CCA planner. Stress-test the rule using filter and refresh hints shared without copying the database. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “any script running in a matching eligible context can use the agreed channel name, so payloads still need validation and least privilege.” Apply this procedure: Send identifiers or invalidations, validate every field and keep authorization on the authoritative service. The expected mechanism is: Schema validation rejects malformed messages without treating channel membership as authorization. For the CCA planner, add one near-miss that exposes putting secrets in messages because the API is same-origin constrained. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: science viewer. Explain the rule using a dataset-version notice sent from a worker to visible pages. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “any script running in a matching eligible context can use the agreed channel name, so payloads still need validation and least privilege.” Apply this procedure: Send identifiers or invalidations, validate every field and keep authorization on the authoritative service. The expected mechanism is: Schema validation rejects malformed messages without treating channel membership as authorization. For the science viewer, add one near-miss that exposes putting secrets in messages because the API is same-origin constrained. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision timer. Transfer the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “any script running in a matching eligible context can use the agreed channel name, so payloads still need validation and least privilege.” Apply this procedure: Send identifiers or invalidations, validate every field and keep authorization on the authoritative service. The expected mechanism is: Schema validation rejects malformed messages without treating channel membership as authorization. For the revision timer, add one near-miss that exposes putting secrets in messages because the API is same-origin constrained. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: family calendar. Predict the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “any script running in a matching eligible context can use the agreed channel name, so payloads still need validation and least privilege.” Apply this procedure: Send identifiers or invalidations, validate every field and keep authorization on the authoritative service. The expected mechanism is: Schema validation rejects malformed messages without treating channel membership as authorization. For the family calendar, add one near-miss that exposes putting secrets in messages because the API is same-origin constrained. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers putting secrets in messages because the API is same-origin constrained.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Send identifiers or invalidations, validate every field and keep authorization on the authoritative service.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Same partition does not remove trust boundaries?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing putting secrets in messages because the API is same-origin constrained be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny protocol laboratory with duplicate, delayed and malformed envelopes handled safely. Include one ordinary case, one boundary and one deliberate failure caused by putting secrets in messages because the API is same-origin constrained. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: any script running in a matching eligible context can use the agreed channel name, so payloads still need validation and least privilege. It shows a trace, not only a final value. The ordinary case should demonstrate “Schema validation rejects malformed messages without treating channel membership as authorization.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Send identifiers or invalidations, validate every field and keep authorization on the authoritative service. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Same partition does not remove trust boundaries, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 19 OF 20 . Transfer with judgment
19. A multi-context fixture proves the protocol
a reliable test opens two receivers and one sender, asserts no self-echo, checks cloned data, closes one receiver and verifies state recovery separately. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is testing two channel objects in one function and calling that a complete browser lifecycle test. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Record endpoint, event ID, version and close state for every observed delivery.
For the A multi-context fixture proves the protocol chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on testing two channel objects in one function and calling that a complete browser lifecycle test. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const a=new BroadcastChannel('fixture');
const b=new BroadcastChannel('fixture');Explained result. A posted message from a can be observed at b, while persistence and late-join behaviour require separate assertions. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision timer. Explain the rule using start and stop intentions coordinated across tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a reliable test opens two receivers and one sender, asserts no self-echo, checks cloned data, closes one receiver and verifies state recovery separately.” Apply this procedure: Record endpoint, event ID, version and close state for every observed delivery. The expected mechanism is: A posted message from a can be observed at b, while persistence and late-join behaviour require separate assertions. For the revision timer, add one near-miss that exposes testing two channel objects in one function and calling that a complete browser lifecycle test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: family calendar. Transfer the rule using an invalidation message telling every view to reread durable state. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a reliable test opens two receivers and one sender, asserts no self-echo, checks cloned data, closes one receiver and verifies state recovery separately.” Apply this procedure: Record endpoint, event ID, version and close state for every observed delivery. The expected mechanism is: A posted message from a can be observed at b, while persistence and late-join behaviour require separate assertions. For the family calendar, add one near-miss that exposes testing two channel objects in one function and calling that a complete browser lifecycle test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: protocol laboratory. Predict the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a reliable test opens two receivers and one sender, asserts no self-echo, checks cloned data, closes one receiver and verifies state recovery separately.” Apply this procedure: Record endpoint, event ID, version and close state for every observed delivery. The expected mechanism is: A posted message from a can be observed at b, while persistence and late-join behaviour require separate assertions. For the protocol laboratory, add one near-miss that exposes testing two channel objects in one function and calling that a complete browser lifecycle test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: lifecycle fixture. Contrast the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “a reliable test opens two receivers and one sender, asserts no self-echo, checks cloned data, closes one receiver and verifies state recovery separately.” Apply this procedure: Record endpoint, event ID, version and close state for every observed delivery. The expected mechanism is: A posted message from a can be observed at b, while persistence and late-join behaviour require separate assertions. For the lifecycle fixture, add one near-miss that exposes testing two channel objects in one function and calling that a complete browser lifecycle test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers testing two channel objects in one function and calling that a complete browser lifecycle test.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Record endpoint, event ID, version and close state for every observed delivery.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from A multi-context fixture proves the protocol?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing testing two channel objects in one function and calling that a complete browser lifecycle test be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny lifecycle fixture with channels opened, messaged, closed and released explicitly. Include one ordinary case, one boundary and one deliberate failure caused by testing two channel objects in one function and calling that a complete browser lifecycle test. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: a reliable test opens two receivers and one sender, asserts no self-echo, checks cloned data, closes one receiver and verifies state recovery separately. It shows a trace, not only a final value. The ordinary case should demonstrate “A posted message from a can be observed at b, while persistence and late-join behaviour require separate assertions.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Record endpoint, event ID, version and close state for every observed delivery. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For A multi-context fixture proves the protocol, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 20 OF 20 . Transfer with judgment
20. Choose the smallest coordination primitive
BroadcastChannel suits transient same-partition notifications; SharedWorker suits richer local coordination, WebSocket suits server exchange and storage owns durable truth. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is expanding one channel into an undocumented distributed system. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. List persistence, topology, ordering, locking, security and offline requirements before selecting the primitive.
For the Choose the smallest coordination primitive chapter on JavaScript BroadcastChannel, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on expanding one channel into an undocumented distributed system. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
// Transport follows the required guaranteesExplained result. The chosen tool should make failure recovery and authority clearer, not merely reduce the first demo to three lines. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: protocol laboratory. Transfer the rule using duplicate, delayed and malformed envelopes handled safely. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel suits transient same-partition notifications; SharedWorker suits richer local coordination, WebSocket suits server exchange and storage owns durable truth.” Apply this procedure: List persistence, topology, ordering, locking, security and offline requirements before selecting the primitive. The expected mechanism is: The chosen tool should make failure recovery and authority clearer, not merely reduce the first demo to three lines. For the protocol laboratory, add one near-miss that exposes expanding one channel into an undocumented distributed system. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: lifecycle fixture. Predict the rule using channels opened, messaged, closed and released explicitly. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel suits transient same-partition notifications; SharedWorker suits richer local coordination, WebSocket suits server exchange and storage owns durable truth.” Apply this procedure: List persistence, topology, ordering, locking, security and offline requirements before selecting the primitive. The expected mechanism is: The chosen tool should make failure recovery and authority clearer, not merely reduce the first demo to three lines. For the lifecycle fixture, add one near-miss that exposes expanding one channel into an undocumented distributed system. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework tabs. Contrast the rule using a task completion notice reflected in two open study-board tabs. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel suits transient same-partition notifications; SharedWorker suits richer local coordination, WebSocket suits server exchange and storage owns durable truth.” Apply this procedure: List persistence, topology, ordering, locking, security and offline requirements before selecting the primitive. The expected mechanism is: The chosen tool should make failure recovery and authority clearer, not merely reduce the first demo to three lines. For the homework tabs, add one near-miss that exposes expanding one channel into an undocumented distributed system. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library dashboard. Stress-test the rule using a sign-out event propagated to unrelated catalogue windows. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “BroadcastChannel suits transient same-partition notifications; SharedWorker suits richer local coordination, WebSocket suits server exchange and storage owns durable truth.” Apply this procedure: List persistence, topology, ordering, locking, security and offline requirements before selecting the primitive. The expected mechanism is: The chosen tool should make failure recovery and authority clearer, not merely reduce the first demo to three lines. For the library dashboard, add one near-miss that exposes expanding one channel into an undocumented distributed system. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers expanding one channel into an undocumented distributed system.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “List persistence, topology, ordering, locking, security and offline requirements before selecting the primitive.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript BroadcastChannel syntax. For this chapter, useful prompts are: “What did you expect from Choose the smallest coordination primitive?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expanding one channel into an undocumented distributed system be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework tabs with a task completion notice reflected in two open study-board tabs. Include one ordinary case, one boundary and one deliberate failure caused by expanding one channel into an undocumented distributed system. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: BroadcastChannel suits transient same-partition notifications; SharedWorker suits richer local coordination, WebSocket suits server exchange and storage owns durable truth. It shows a trace, not only a final value. The ordinary case should demonstrate “The chosen tool should make failure recovery and authority clearer, not merely reduce the first demo to three lines.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: List persistence, topology, ordering, locking, security and offline requirements before selecting the primitive. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Choose the smallest coordination primitive, separate the documented JavaScript BroadcastChannel mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Parent guide: choose the next useful step
Start with evidence, not a label such as careless. Ask for one prediction and one trace. If the first transition is wrong, rebuild the model. If the model is sound but syntax fails, practise reference use. If routine cases are correct but boundaries fail, vary ties, defaults, unsupported inputs, ownership or missing paths. If explanations transfer, move to a small project.
Keep a weekly record with four lines: concept, prediction, observed difference and next test. Stop when fatigue replaces reasoning. A smaller case tomorrow is more useful than another hour of copying tonight.
Seek specialist help when cause and effect remain invisible after examples are reduced, when accessibility or data-loss implications are unclear, or when an important repository, database or application state may be at risk. Good support should make the learner’s reasoning more independent.
Capstone practice with explained routes
1. homework tabs: model, boundary and recovery
Create a small homework tabs using a task completion notice reflected in two open study-board tabs. Combine “A name opens a broadcast channel” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: new BroadcastChannel(name) creates an EventTarget associated with that exact channel name. Apply: Centralise the channel constant and assert the name property in every context. Verify: bus.name is the exact constructor string and only matching channel names are candidate destinations. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
2. library dashboard: model, boundary and recovery
Create a small library dashboard using a sign-out event propagated to unrelated catalogue windows. Combine “Messages use structured serialization” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: postMessage serializes supported structured data, so nested arrays, objects and cloneable built-ins can cross the channel without JSON text. Apply: Define a plain-data envelope and run unsupported values through a small failure fixture. Verify: A receiving event obtains a structured clone of the supported envelope rather than the sender’s object identity. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
3. CCA planner: model, boundary and recovery
Create a small CCA planner using filter and refresh hints shared without copying the database. Combine “messageerror exposes deserialization failure” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: BroadcastChannel supports a messageerror event for cases where delivered data cannot be deserialized in the destination context. Apply: Record messageerror separately from application-level validation errors. Verify: The error route is observable and should not be confused with an unknown application message type. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
4. science viewer: model, boundary and recovery
Create a small science viewer using a dataset-version notice sent from a worker to visible pages. Combine “Eligibility follows document and worker lifecycle” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: a window must have a fully active document, while a worker must not be closing or suspendable, to be eligible for messaging. Apply: Treat resumption as a state-reconciliation moment and reread durable truth. Verify: The visible context repairs possible gaps instead of assuming continuous eligibility. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
5. revision timer: model, boundary and recovery
Create a small revision timer using start and stop intentions coordinated across tabs. Combine “close ends this channel object” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: close sets the object’s closed flag and lets it become collectable when no other references keep it alive. Apply: Pair construction and close in the same ownership unit. Verify: After close, this object is no longer a live endpoint and postMessage on it raises InvalidStateError. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
6. family calendar: model, boundary and recovery
Create a small family calendar using an invalidation message telling every view to reread durable state. Combine “Idempotency protects duplicate effects” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: application protocols should tolerate repeated or superseded messages even when the transport itself is simple. Apply: Attach event IDs or authoritative revisions and record the last applied value. Verify: A duplicate logical event becomes a no-op while a newer revision still triggers reconciliation. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
7. protocol laboratory: model, boundary and recovery
Create a small protocol laboratory using duplicate, delayed and malformed envelopes handled safely. Combine “A multi-context fixture proves the protocol” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: a reliable test opens two receivers and one sender, asserts no self-echo, checks cloned data, closes one receiver and verifies state recovery separately. Apply: Record endpoint, event ID, version and close state for every observed delivery. Verify: A posted message from a can be observed at b, while persistence and late-join behaviour require separate assertions. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
8. lifecycle fixture: model, boundary and recovery
Create a small lifecycle fixture using channels opened, messaged, closed and released explicitly. Combine “Storage key and name define the audience” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: destinations must be eligible, have an equal storage key and use the same channel name. Apply: Test same-site top-level contexts and an intentionally partitioned or different-origin case separately. Verify: Only matching contexts inside the applicable storage partition can receive its broadcasts. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
Frequently asked questions
How long should a practice session be?
Use one complete prediction–observation–explanation cycle while attention remains good. Ten to twenty focused minutes can be enough.
Should every option or function be memorised?
No. Memorise the governing distinctions and practise retrieving the official reference. Understanding means predicting and explaining, not reciting a parameter list.
What if the result is correct but the explanation is weak?
Treat it as partial success. Ask for a trace and change one boundary. A reliable model survives controlled variation.
Is the shortest solution the best?
Not automatically. Prefer the solution whose semantics, failure modes and maintenance cost are easiest to justify for the actual project.
When should official documentation be used?
Use it whenever syntax, supported types, SQL dialect behaviour or Git version details matter. Primary documentation settles the current contract.
How can a parent help without technical expertise?
Ask what was predicted, where the first difference appeared, what evidence matters and which smaller example could isolate it.
How do we test transfer?
Change the context, vocabulary and one boundary. Require the learner to identify the invariant before using a tool.
What should be saved after practice?
Keep the corrected rule, one trace, one boundary case and the next question. Avoid storing pages of unexplained output.
Can these exercises replace backups?
No. Use disposable examples and proper backups. Learning should not endanger schoolwork, repositories or personal data.
What counts as mastery?
The learner can predict, verify, diagnose, recover and justify a choice across more than one context, while knowing when to consult the current reference.

