napi backend: incoming ObjC blocks are bridged without retention — async completion/decision handlers die after the delegate returns
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp, objective-c
- Lĩnh vực
- backend
Hướng nghiên cứu
The payload names no files. Start from the code that marshals incoming ObjC block parameters into JS FunctionPointer values, and check whether it retains the block. The fix must either copy the block (_Block_copy, released when the JS handle is released) or document the call-before-return limit. Done means an async JS call to a completion handler still works after the delegate returns, without the WebKit CompletionHandlerCallChecker abort. The maintainers have not chosen between copying and documenting, so confirm that choice before writing code.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
ObjC blocks that arrive as method parameters — completion handlers and decision handlers — are marshalled to JS as FunctionPointers over the raw NSBlock*, with no _Block_copy/retention. The block is only guaranteed alive for the duration of the delegate call; a JS caller that invokes it asynchronously — the standard pattern for WKUIDelegate runJavaScript*Panel/openPanel handlers, webView:requestMediaCapturePermissionFor… decisions, photo/auth completion handlers, and the like — dereferences a dead block. WebKit's CompletionHandlerCallChecker then aborts the process ("completion handler was not called") when its block deallocates un-invoked.
Expected
Either copy incoming blocks when marshalling them to JS — so a JS-held FunctionPointer keeps the handler alive until explicitly released — or expose/document the call-before-return constraint. Today the pointer looks callable indefinitely; there is no lifetime signal until the abort.
Workaround we run: grab the raw pointer (__ns_native_ptr) and _Block_copy/_Block_release around the async call window.
Environment
NativeScript/runtimes5b697b39, generic napi backend,TARGET_PLATFORM=macos(the same block-marshalling path ships in the iOS napi runtime, where asyncWKUIDelegate/PHPhotoLibrary-style completions hit the same lifetime gap)
- Ngôn ngữ chính
- C++
- Star
- 27
- Fork
- 5
- Merge trung bình
- 5 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NativeScript/runtimes
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
NativeScript/runtimes#110 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
NativeScript/runtimes#109 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
NativeScript/runtimes#108 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 40/100
NativeScript/runtimes#107 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
NativeScript/runtimes#106 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NativeScript/runtimes
Issue tương tự
-
Linux npm packaging leaves workspace files that block subsequent CI checkoutCó thể đã có người làm @Spockkk0225 đã nhận hôm nay. Đang mởci
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
alibaba/neug#1195 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
QA/No release-notes/exclude tests tests/missing-coverage tests/test-quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
brave/brave-browser#61019 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
? - Needs Triage bug CUTLASS C++
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 4 ngày