improve crashlogs

This commit is contained in:
KingKDot
2026-06-29 00:01:07 -05:00
parent 2c42a989cf
commit 5f598aa10b
9 changed files with 136 additions and 1 deletions
+7
View File
@@ -667,6 +667,10 @@ func runSession(ctx context.Context, cancel context.CancelFunc, conn *websocket.
if cfg.FetchPublicIP {
hello.PublicIP = config.FetchPublicIPAddress()
}
if report, ok := loadPendingCrashReport(); ok {
hello.LastCrashReason = report.Reason
hello.LastCrashDetail = truncateStr(fmt.Sprintf("%s at %s", report.Detail, report.At), 1200)
}
if err := wire.WriteMsg(ctx, env.Conn, hello); err != nil {
return fmt.Errorf("send hello: %w", err)
@@ -712,6 +716,9 @@ func runSession(ctx context.Context, cancel context.CancelFunc, conn *websocket.
cancel()
return fmt.Errorf("send initial ping: %w", err)
}
if hello.LastCrashReason != "" {
clearPendingCrashReport()
}
if interval := getPingInterval(); interval > 0 {
log.Printf("ping: heartbeat interval=%s", interval)