Skip to content

fix(signaling): add null safety guards to JSON event parsing (WT-599)#963

Closed
SERDUN wants to merge 1 commit into
developfrom
fix/signaling-null-safety-guards
Closed

fix(signaling): add null safety guards to JSON event parsing (WT-599)#963
SERDUN wants to merge 1 commit into
developfrom
fix/signaling-null-safety-guards

Conversation

@SERDUN

@SERDUN SERDUN commented Feb 23, 2026

Copy link
Copy Markdown
Member

Description

Prevent _TypeError crashes ('Null' is not a subtype of 'String') in signaling event deserialization when the server sends malformed or incomplete JSON messages. This addresses the critical incident pattern with 337 occurrences across PortaPhone, Signal Connect, Vox OmniOne, and Call Home.

Crash Prevention Summary

Severity Count Scope
CRITICAL 8 Confirmed crash sources (call_id, user_active_calls, etc.)
HIGH 11 Preventive guards for identical deserialization patterns
MEDIUM 1 Edge cases

Key Changes

  • Safe Primitives: Added as Type? ?? default fallbacks for String, int, and bool fields (e.g., call_id, remote_number, keepalive_interval).
  • Safe Collections: Replaced unsafe as List casts with as List<dynamic>? ?? []. Implemented .whereType<T>() to prevent internal element cast crashes.
  • Safe Enums: Replaced direct Enum.values.byName() with try-catch wrappers to provide safe default values for null or unknown server strings.
  • Safe Objects: Added null checks for nested Maps before accessing keys (e.g., candidate in IceTrickleEvent).

Branch: fix/signaling-null-safety-guards | Commit: b5e66657

Prevent _TypeError crashes ('Null' is not a subtype of 'String') in
signaling event deserialization when server sends malformed or incomplete
JSON messages. This addresses the critical incident pattern with 337
occurrences across PortaPhone, Signal Connect, Vox OmniOne, and Call Home.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SERDUN SERDUN added the draft Not ready but can be start to review label Feb 23, 2026
@SERDUN SERDUN closed this Feb 23, 2026
@SERDUN SERDUN deleted the fix/signaling-null-safety-guards branch April 8, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft Not ready but can be start to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant