Skip to content

snapshotEventTarget rejects target.id === null; Lynx for Web sends null for an element with no id #460

Closed

Description

@Huxpro

Summary

Every tap on Lynx for Web is dropped by Octane's own payload validator:

TypeError: Octane Lynx native event payload root.target.id must be a string.

The event reaches routeToken correctly (the #346 background-receiver fix works on web) and then dies in snapshotEventTarget (packages/lynx/src/core/native-events.ts).

Evidence

@lynx-js/web-core reports target.id === null for a <text bindtap={…}> with no id attribute; everything else in the payload is contract-clean (uid a positive finite number, dataset a plain object, type a string). The validator required a string:

const id = target.id;
if (typeof id !== 'string') throw payloadError(`${path}.id`, 'must be a string.');

Fix

LynxNativeEventTargetSnapshot.id widened to string | null; the snapshot accepts null and normalizes an omitted undefined id to null — keeping "no author id" distinct from an author-assigned empty-string id, matching the PAPI's __SetID(node, id: string | null). (The two web hosts disagree on whether they send null vs undefined, so both are covered.)

Impact

Blocks all click-driven interaction on Lynx for Web (once the handshake is fixed — see below). Independent of the other bugs.

Status

Fixed in #459 (verified end-to-end: mounting an example through @lynx-js/web-core and driving a real click). This bug is one of a set blocking Lynx for Web; the other two (a blank engine-mode first screen and a "readiness deadlock") turned out to share a single cross-realm message-validation root cause, also fixed in #459.


Filed by an agent (agent-authored).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions