Skip to content

Conversation

@lynxassistant
Copy link

@lynxassistant lynxassistant bot commented Dec 24, 2025

No description provided.

Ensure the response handler listener will be triggered correctly even if there is
no reference to the handler object in javascript. Making it work the same way as `Promise`
object.

Introduce unit tests for response handler behavior in both JSI and Lepus
runtimes. Tests verify that listener callbacks fire even after the handler
object is released, and that delegate invocation occurs as expected.

Key changes:
- Add BUILD targets and test groups for JS and Lepus response handler tests.
- Implement response_handler_in_js_unittest.cc and
  response_handler_in_lepus_unittest.cc.
- Refactor JS handler to avoid weak_from_this usage:
  - Capture native_app weak_ptr directly and guard against destruction.
  - Use ApiCallBack and delegate-driven invocation for JS callbacks.
  - Make ConvertBundleInfoToPiperValue static and require app pointer.
- Refactor Lepus handler closure capture to use delegate pointer safely,
  relying on LazyBundleLoader guarantees.
- Fix renderer_functions to copy closure arg to ensure safe asynchronous use.

TEST: Added unit tests for both runtimes and wired them into lynx_test.

issue: f-6798197892
AutoSubmit: true
@jianliang00 jianliang00 force-pushed the shadow/p/nhsprite/change-1766580339-cRv8XPZu branch from 6838b09 to 9cab417 Compare December 24, 2025 13:27
@jianliang00 jianliang00 merged commit 8837bac into release/3.5 Dec 25, 2025
19 checks passed
@jianliang00 jianliang00 deleted the shadow/p/nhsprite/change-1766580339-cRv8XPZu branch December 25, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants