Improve WebGL Support
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- game-dev, observability-sre
Hướng nghiên cứu
Bắt đầu với các đường dẫn stack trace của WebGL trong DebugStackTrace.cs và AotHelper.cs, sau đó xem xét SentryInitialization.cs về phần tích hợp tracing khi khởi động đang bị vô hiệu hóa. Sử dụng SmokeTester.cs và thiết lập smoke testing WebGL hiện có để điều tra hành vi. Công việc được xem là hoàn tất khi có phạm vi WebGL được xác định và các bài kiểm thử bao phủ những cải tiến đã chọn về exception, logging hoặc tracing khi khởi động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
The SDK's WebGL support is currently limited to C#.
Current Limitations
PlayerSettings.WebGL.exceptionSupport
None- Not supported. See https://github.com/getsentry/sentry-unity/pull/2141 for more details.Explicitly Thrown Exceptions Only- Captures and reports exceptions but misses stack trace.Full Without Stacktrace- Captures and reports exceptions but misses stacktrace.Full With Stacktrace- Captures and reports exception and provides a stacktrace (albeit with no line numbers due to lack of IL2CPP backend availability)
Fails to create new StackTrace()
This is happening with Explicitly Thrown Exceptions Only and Full Without Stacktrace.
The SDK fails trying to create a new SentryStackTrace. The SDK fails with Could not resolve stack frame. This is due to the DebugStackTrace failing to create a managed frame. It relies on the following snippet used in the AotHelper
var stackTrace = new StackTrace(false);
return stackTrace.GetFrame(0)?.GetMethod() is null;
To resolve this we could provide our own dedicated WebGLStackTraceFactory to create a new frame and fall back on stackFrame.ToString() instead of doing nothing. And probably skip a whole lot of other, for WebGL unnecessary checks i.e.
if (CreateFrame(stackFrame) is { } frame)
{
yield return frame;
}
else
{
yield return new SentryStackFrame { Function = stackFrame.ToString() };
}
Missing stack trace for LogError events
The missing stacktrace also mentioned in https://github.com/getsentry/sentry-unity/issues/2091#issuecomment-2839750715 is also related to the PlayerSettings.WebGL.exceptionSupport. When setting to FullWithStacktrace the SDK is able to provide stack traces for these events as well. Set to any other option Unity does not pass down a stack trace to the logging integration and we'd need to create a new stack trace, bringing us back to the point above.
Current Recommendation
The current recommendation is to set PlayerSettings.WebGL.exceptionSupport to Full With Stacktrace to get the most out of the SDK. Anything else will require us to build a WebGL specific integration to better handle those cases.
Future Plans
Native Support
Taken from @vaind https://github.com/getsentry/sentry-unity/issues/668#issuecomment-1099453415
Stack traces for the embedded code coming from Unity's .jslib are pretty limited. They're just not there on the error reported by the browser.
The integration could still be useful at least to get the error type/text + stack traces if they're coming from standard javascript files.
- Add
sentry-jsbundle to the sentry-unity package. The minified version should be fine: https://browser.sentry-cdn.com/10.24.0/bundle.min.js - Create a
PostBuildstep to alter the generatedindex.html, adding the Sentry-javascript initialization to the beginning of<head>:
<script src="Build/bundle.js"></script>
<script>
Sentry.init({
dsn: "https://[email protected]/5439417",
release: "0.1.0",
....
});
</script>
- We're already smoke testing for WebGL. Use the
SmokeTester.csto create a javascript error. The existing python server would capture and check that. - [optional] Implement scope sync - requires individual functions, similar to Objective-C
Startup Tracing
Currently, the startup tracing integration is disabled for WebGL due to the UnityWebRequestTransport seemingly not being ready this early in the runtime.
This could be solved by creating timestamps instead of starting the spans and creating and sending the transaction after the fact.
- Ngôn ngữ chính
- C#
- Star
- 294
- Fork
- 63
- Merge trung bình
- 3 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 26
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 getsentry/sentry-unity
-
Feature Unity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
getsentry/sentry-unity#2923 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Tests Unity
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
getsentry/sentry-unity#2918 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Drop `Release` and `Environment` from the editor config windowCó thể đã có người làm @armadavalor đã nhận 3 ngày trước. Đang mởBreaking Change Editor Good First Issue Improvement Unity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
getsentry/sentry-unity#2914 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Make CI stable and fasterĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
getsentry/sentry-unity#2913 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Feature Unity
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
getsentry/sentry-unity#2796 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của getsentry/sentry-unity
Issue tương tự
-
Incorrect loop bound in SizeOptIListSelectIterator.ToListCó thể đã có người làm @equmagg đã nhận hôm nay. Đang mởarea-System.Collections untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
dotnet/runtime#137126 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/azure-sdk-for-net#64658 · 1 bình luận · 1 reaction ·
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
dotnet/aspnetcore#70370 ·
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
NethermindEth/nethermind#15684 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/ai-assistant squad/flyt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Altinn/altinn-studio#21798 ·
Maintainer thường phản hồi trong vòng 1 ngày