Problem
StreamEvent.parse() manually deserializes JSON using JSONSerialization and casts through [String: Any] dictionaries. This is verbose, loses type safety, and silently swallows malformed data.
Location
apps/purepoint-macos/purepoint-macos/Models/StreamEvent.swift — parse() and its 4 private helper methods
Suggested Fix
Define Codable structs for the wire format and use JSONDecoder. The discriminated union pattern (switching on a type field) can be handled with a custom init(from:) on StreamEvent.
🤖 Generated with Claude Code
Problem
StreamEvent.parse()manually deserializes JSON usingJSONSerializationand casts through[String: Any]dictionaries. This is verbose, loses type safety, and silently swallows malformed data.Location
apps/purepoint-macos/purepoint-macos/Models/StreamEvent.swift—parse()and its 4 private helper methodsSuggested Fix
Define
Codablestructs for the wire format and useJSONDecoder. The discriminated union pattern (switching on atypefield) can be handled with a custominit(from:)onStreamEvent.🤖 Generated with Claude Code