GeezerVison is showing github.com — fix(worker): open a handle scope per delivered message, and fix two messaging specs by edusperoni · Pull Request #2090 · NativeScript/android
Conversation
edusperoni
commented
Nov 5, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Three fixes from CodeRabbit's review of #2043 and #2040 that weren't addressed before the stack merged.
- A handle scope per delivered worker message.
WorkerWrapper::DrainPendingTasks dispatches a whole batch of queued messages under one HandleScope, and WorkerEvents::EmitMessage opened none of its own. So the handles created while delivering every message in a batch (the deserialized payload, ports, the event and whatever listeners allocate) stayed alive until the batch ended. EmitMessage now opens its own scope, which is what the comment on SerializedValue::Deserialize already says each caller does. The parent-side path and NativeMessagePort::Drain already had a per-message scope.
- The
on() + once() spec waited for the wrong reply. "lets the same listener be on() and once() at the same time" started its settle timer at the third reply but expects four, so it failed whenever the fourth reply took longer than the 400 ms settle window. It now waits for the fourth reply and then settles to catch a fifth. Its comment had the two registrations swapped and is corrected too.
- A caller-set
DOMException stack. The structuredClone canary now sets a sentinel stack and asserts that the clone carries it. Before, only the stack the constructor generates was checked.
Independent of #2087, #2088 and #2089; it merges cleanly with each of them, in any order. Full device suite on a Pixel_3a_API_36 arm64 emulator: 1456 specs, 0 failures.
The same EmitMessage scope gap (Worker.mm OnMessageCallback) and the same spec bug (MessagingTests.js) exist on iOS.
Summary by CodeRabbit
- Bug Fixes
- Improved worker message handling to support reliable delivery when the same listener is registered for both repeated and one-time notifications.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…the fourth reply in the on()+once() spec
coderabbitai
Bot
commented
Nov 5, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Walkthrough
-
The changes add a V8 handle scope to worker message delivery. They also update tests for worker listener invocation counts and preservation of a DOMException stack during structured cloning.
Changes: Worker Message Delivery
| Layer / File(s) |
Summary |
Message delivery and listener test test-app/runtime/src/main/cpp/WorkerEvents.cpp, test-app/app/src/main/assets/app/tests/testMessaging.js |
EmitMessage now opens a V8 HandleScope before processing a message. The listener test waits for four invocations and checks the existing expected message array. Comments describe three on() notifications and one once() notification. |
DOMException Structured Clone
| Layer / File(s) |
Summary |
DOMException stack test test-app/app/src/main/assets/app/tests/testRuntimeImplementedAPIs.js |
The test sets a stack sentinel on the original DOMException and checks that the cloned exception preserves it. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
Merge Risk: Minimal · up to b5b3f
-
No merge-blocking issue was identified in the worker scope or test changes.
Pre-merge checks: 4 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
 |
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
Passed checks: 4 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title clearly and concisely identifies the worker handle-scope fix and the two messaging specification fixes, which match the main changes. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
A rabbit checks the worker’s pace Four messages arrive in place Three on() calls, one once() too A stack sentinel makes it through Scoped handles hop, then rest anew
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|