Skip to content

fix: retain contact capture while virtual lists recycle - #59

Merged
rdlabo merged 4 commits into
mainfrom
fix/virtual-list-overlay
Nov 16, 2026
Merged

rdlabo merged 4 commits into
mainfrom
fix/virtual-list-overlay

Conversation

@rdlabo

@rdlabo rdlabo commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Virtual list recycling and momentum can retire an unacquired contact capture just before a native action opens a Web overlay. Retain pending acquisition across visual invalidations while retiring completed pixels and obsolete source revisions.

Connect Android Core and SDK registrations to one contact-acquisition path. Hosted SDK contact stops source motion, measures current bounds, and acquires immutable pixels before original SDK input. Reuse existing Window replay only when acquisition is needed; ready pixels keep synchronous input delivery. Preserve native taps/long presses on timeout or failure, retire token-associated requests on release, and retain acquisition-time anchors while PNG processing finishes.

In the shared SDK session, defer fallback hiding only while the selected contact capture is being processed or decoded. Failure resumes fallback and explicit none hides immediately. Native visibility/restoration semantics remain unchanged. Android advertises that capture can be armed during Web input; iOS keeps its existing capability policy.

Validation: 150 browser tests pass; all four pinned-contact fallback regressions also pass, including a new iOS-capability-style hung-response timeout and late-token release case; Android contact/input/SDK tests 16/16 and existing scroll hosting 9/9 pass. Full native suite is 54/55 locally; its fractional placement assertion also fails on the unchanged baseline. Android API35 integrated Scroll/Virtual/combined tests pass 9/9 with same-token native entry-copy drawing and subsequent visible Web images. iOS26.5 passes12/12; iOS27.2 combined6/6 and Virtual3/3 pass, with Scroll3/3 on isolated rerun after a failed concurrent run. Local supervisor/independent reviews were repeated until implementation findings were resolved.

Limit: optional capture still falls back on the existing composited-copy/Web-draw deadline under load. A concurrent stress run hit that deadline; four isolated composited SDK runs completed cover-to-painted in118–157ms. Tests use simulators/emulators and real native controls, not physical devices or the AdMob SDK itself.

The complementary plugin acknowledgement/Core wiring is tracked in webview-native-ui/capacitor-plugin#56. Its Android API adoption waits for this Engine API to be released and plugin dependency pins updated. Release-only generated runtime artifacts remain excluded from main and are generated by the existing release workflow.

@devin-ai-integration

Copy link
Copy Markdown

レビュー

1. CI android が落ちている(回帰の可能性が高い)

connectedDebugAndroidTest で既存テストが2件失敗しています。

  • NativeUIScrollHostingTest > imageOwnsPixelsBeforeNativeDragAndSamePhotoTapReachesSDK
  • NativeUIScrollHostingTest > firstPhotoLongPressReachesSDKWithOriginalTiming

main の直前のコミット c02ab01(#58)では android が pass しています。また NativeUIScrollHostingTest はこの PR で変更されていません。したがって、2コミット目の NativeUISnapshots.kt / NativeUIProjection.kt の変更(contact acquisition を SDK input の前に移した部分)で、NativeUIScrollHosting 経由の drag / long press の経路が壊れている可能性が高いです。ios-* / swift-package は実行中です。

2. session.ts の visibility 条件が contact 以外にも広がっている

if (destination !== 'web' || (!manager.token && !manager.capturingContact))
  await bridge.send({ action: 'visibility', visible: false });

この分岐では、以前は無条件に visible: false を送っていました。今回の変更で capturingContact に加えて manager.token がある場合も送らなくなっています。description とドキュメントには「contact request の完了を待つ」としか書かれていません。token がある web fallback で native を隠さなくなるのは意図した変更でしょうか。意図しているなら、その後で誰が native を隠すのか(wake() の経路か)をコメントで残してください。

3. capturingContact が解除されない場合

capturingContact は capturesInFlight の finally でしか false になりません。JS 側の call() にはタイムアウトがないので、native 側の応答が返らないと、web fallback 中も native view が表示されたままになります。Android は captureDelayMs とテスト captureTimeoutPreservesNativeTap で担保されています。iOS(prepareDuringInteraction を広告しないホスト)でも同じ上限が保証されるか確認してください。

4. その他

  • retainPending: true を、scroll owner の有無に関係なくすべての visual change で送るようになりました。ownership / revision の変化は consider / invalidate 側で cancel されるので理屈は通ります。ただ、既存の iOS ネイティブ側が retainPending を scroll 専用と想定していないかは確認してください(types.ts のコメントは更新済み)。
  • capacitor-plugin#56 と合わせた状態での実機確認が残っている点は、description のとおりです。

Written by Devin

@rdlabo
rdlabo merged commit 8358ac5 into main Nov 16, 2026
16 of 18 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.

1 participant