GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(runtime): keep clone-only message reads read-only, and see an uncloneable brand created mid-clone by adrian-niculescu · Pull Request #2064 · NativeScript/android

Conversation

@adrian-niculescu

@adrian-niculescu adrian-niculescu commented Oct 6, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

An object marked with markAsUncloneable from a getter, during the clone that reaches it, is cloned instead of throwing DataCloneError when that is the first markAsUncloneable call in the isolate. The serializer reads the brand once, when it is constructed, and at that point the brand does not exist yet. It now picks the brand up once markAsUncloneable creates it.

Separately, SerializedValue::Deserialize cleared its transfer vectors on every read. A clone-only message is read by every BroadcastChannel receiver, and every getEnvironmentData call, with no lock, so those clears were concurrent writes to shared state, against what the comment on the consumed_ flag intends. Only the single receiver of a message with transferables writes them now.

Stacked on #2043; the same fix for iOS is NativeScript/ios#490. The new markAsUncloneable spec fails on that branch and passes here, and the full device suite passes. The deserialization race has no deterministic spec.

Summary by CodeRabbit

  • Bug Fixes
    • Structured cloning now correctly reports a DataCloneError when it encounters an object marked as uncloneable during serialization.
    • Deserialized values with transferables remain single-use, while values without transferables can be read without triggering transferable cleanup.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@adrian-niculescu
fix(runtime): keep clone-only message reads read-only, and see an unc…
cf36bd1
…loneable brand created mid-clone

A clone-only message is read concurrently by every BroadcastChannel receiver and every getEnvironmentData call, and deserializing it cleared its transfer vectors, a write. Only the single receiver of a message with transferables writes them now.

The serializer cached the uncloneable brand when it was created, so the first markAsUncloneable call in an isolate, made by a getter in the graph being written, went unseen and the marked object was cloned. It now picks the brand up once it exists.
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 251f22e8-9341-43d9-9993-1b569a175846
📥 Commits

Reviewing files that changed from the base of the PR and between 42a8bcf and cf36bd1.

📒 Files selected for processing (3)
  • test-app/app/src/main/assets/app/tests/messaging/uncloneableInGetterWorker.js
  • test-app/app/src/main/assets/app/tests/testMessaging.js
  • test-app/runtime/src/main/cpp/StructuredSerialization.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The change updates structured serialization to detect an uncloneable brand created while a getter runs during cloning, and to apply single-consumer handling and transferable-storage cleanup only when transferables are present. It adds a worker regression test for the clone error.

Changes

Structured serialization

Layer / File(s) Summary
Detect brands created during cloning
test-app/runtime/src/main/cpp/StructuredSerialization.cpp, test-app/app/src/main/assets/app/tests/messaging/uncloneableInGetterWorker.js, test-app/app/src/main/assets/app/tests/testMessaging.js
IsHostObject refreshes an empty cached uncloneable brand. A worker regression test checks that marking an object uncloneable from a getter causes a DataCloneError.
Condition cleanup on transferables
test-app/runtime/src/main/cpp/StructuredSerialization.cpp
Deserialize uses the presence of transferables to control single-consumer marking and cleanup of transferred buffer and port storage.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: edusperoni

Merge Risk: ⚪ Minimal · up to cf36b

No merge-blocking issue is established; the change is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes both main runtime fixes: read-only clone-only message reads and detection of an uncloneable brand created during cloning.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

A rabbit watched the getter run,
Then saw the clone report its error.
With transferables, storage clears;
Without them, vectors stay in place.
The rabbit hops through tests with cheer.

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adrian-niculescu adrian-niculescu mentioned this pull request Oct 6, 2026
fix(runtime): keep clone-only message reads read-only, and see an uncloneable brand created mid-clone NativeScript/ios#490
Merged
@adrian-niculescu
adrian-niculescu marked this pull request as ready for review October 6, 2026 19:18
@adrian-niculescu

adrian-niculescu commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adrian-niculescu adrian-niculescu mentioned this pull request Oct 6, 2026
fix(runtime): deliver a posted undefined as undefined, not null NativeScript/ios#477
Merged
@edusperoni
edusperoni deleted the branch NativeScript:feat/worker-threads November 5, 2026 19:02
@edusperoni edusperoni closed this Nov 5, 2026
@edusperoni edusperoni mentioned this pull request Nov 5, 2026
fix(runtime): keep clone-only message reads read-only, and see an uncloneable brand created mid-clone #2088
Merged
@adrian-niculescu
adrian-niculescu deleted the fix/serialization-shared-reads branch November 6, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

2 participants

@adrian-niculescu @edusperoni
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.