Skip to content

fix: truapi ^0.4 products connect via MessagePort handoff - #42

Merged
valentinfernandez1 merged 1 commit into
mainfrom
vf/truapi-0.4-fix
Jul 20, 2026
Merged

fix: truapi ^0.4 products connect via MessagePort handoff#42
valentinfernandez1 merged 1 commit into
mainfrom
vf/truapi-0.4-fix

Conversation

@valentinfernandez1

Copy link
Copy Markdown
Collaborator

What

@parity/truapi 0.4 products open the iframe channel by posting truapi-ready
and waiting for a truapi-init reply with a transferred MessagePort. The test
host never answered, so waitForConnection() timed out on every 0.4 product.
The host now answers the handshake and serves all traffic over the port.
0.3 products keep using plain window postMessage; both generations talk to the
same container.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​parity/​truapi@​0.4.18110010096100

View full report


import { getClientSync } from '@parity/truapi/sandbox';

const DOTNS_ID = 'test-product.dot';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this ID specifically?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason, it's just what is used in the tests

const DOTNS_ID = 'test-product.dot';

@TarikGul TarikGul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small question - 👍

@pgherveou pgherveou left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we completely migrate away from @novasamatech/* deps.
project that still need to test out the legacy stack can use a pinned version of host-api-test-sdk

*/

import type { Provider } from '@novasamatech/host-api';
import { createIframeProvider } from '@novasamatech/host-container';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move all the @novasamatech/* related code in a legacy file, to make it easier to clean up in a follow up PR if we think we do need the dual mode for now

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the newest version of truapi containing the core was just released and it is just now landing on product-sdk. I think it is better to first add this patch and then cleanup novasama deps as to not introduce any breaking changes

@valentinfernandez1
valentinfernandez1 merged commit 3aba914 into main Jul 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants