Files
DeepSeek-Reasonix/workers
SivanCola 26aa92cb2d Harden crash diagnostics and recurring runtime failures / 强化崩溃诊断并修复高频运行时故障 (#6678)
* fix: harden crash diagnostics and runtime failures

Problem:
Crash telemetry mixed actionable release failures with browser notices, development reports, and isolated timer spikes. Several recurring desktop crashes remained in virtualized React lists, Mermaid pan/zoom, legacy WebKit, and concurrent secret redaction.

Root cause:
Virtualizer measurement updates could re-enter React commits, svg-pan-zoom inverted singular matrices before layout stabilized, react-markdown assumed Object.hasOwn, and the key/value redactor relied on a complex regexp replacement path. Opaque Script errors also lacked safe grouping context.

Fix:
Separate diagnostic lanes and effective severities, preserve legacy fingerprints while adding optional safe hints, require sustained or corroborated lag, use direct DOM virtualizer updates, guard Mermaid layout synchronization, polyfill Object.hasOwn, and replace the backtracking redactor with a linear scanner.

Verification:
go test ./...
go vet ./...
go test -race ./internal/secrets
(cd desktop && go test ./...)
(cd desktop/frontend && pnpm test:all && pnpm build)
(cd workers/crash-report && npm test -- --run && npm run typecheck)

* fix: isolate development crash groups

Problem:
Development and stable reports shared one fingerprint, so a low-severity development observation could hide an actionable release crash.

Root cause:
The fingerprint omitted the report environment while the group upsert persisted low severity and dashboard classification trusted the latest version/channel.

Fix:
Keep stable hashes unchanged, namespace development fingerprints with dev:, preserve dashboard routes for both formats, and only reclassify legacy groups when both ends of their history are development builds.

Verification:
- npm test -- --run
- npm run typecheck
- npm exec -- wrangler deploy --dry-run --outdir /tmp/reasonix-pr-6678-worker-dryrun
- git diff --check

* fix: keep ambiguous legacy crash groups actionable

Problem:
Legacy crash groups could contain a stable observation between development reports and still be downgraded as development-only.

Root cause:
The dashboard inferred complete group provenance from first/last version metadata even though sample retention can prune middle release reports.

Fix:
Treat only the explicit dev: fingerprint namespace as proof of a development-only group, keep legacy hashes actionable, and cover dev-release-dev history in regression tests.

Verification:
- npm test -- --run
- npm run typecheck
- npm exec -- wrangler deploy --dry-run --outdir /tmp/reasonix-pr-6678-worker-dryrun
- git diff --check
2026-07-19 17:06:46 +08:00
..