Skip to content

Conversation

@zew-rgn
Copy link
Collaborator

@zew-rgn zew-rgn commented Feb 6, 2026

Summary

  • Security: Fixed certificate validator (C1), redacted API tokens from logs (S1), documented API key baking risk (M7)
  • Testing: Added 49 new unit tests for WebSocketService, WebSocketDataSyncService, and CertificateValidator (C2)
  • Architecture: Extracted ActionCable handshake into dedicated service reducing 165→65 lines (M8), documented core→features dependency (M1)
  • Reliability: Fixed timeout reporting (M2), reconnect concurrency (M3), disconnect cleanup (M4), heartbeat guard (M5), cache error handling (M6), room cache race condition (M9)
  • Code quality: Proper test mocks (L1), UUID for request IDs (L2), web platform header warning (L4), REST config documentation (M10)

Test plan

  • All 49 new unit tests pass (20 WebSocketService + 14 WebSocketDataSyncService + 15 CertificateValidator)
  • Full test suite: 944 pass, 9 fail (all pre-existing, 0 regressions)
  • Manual smoke test: login, WebSocket connection, device sync
  • Verify certificate behavior on staging (reject invalid certs in release mode)

🤖 Generated with Claude Code

Security fixes:
- C1: Certificate validator rejects in production, accepts only in debug
- S1: API tokens redacted from WebSocket URI logs with URI sanitizer
- M7: Documented API key binary baking risk in environment config

Testing:
- C2: Added 49 unit tests for WebSocketService (20), WebSocketDataSyncService (14), CertificateValidator (15 pre-existing)

Architecture & code quality:
- M8: Extracted ActionCable handshake into ActionCableAuthService (165 → 65 lines)
- M1: Documented core→features dependency as tech debt
- M10: Documented vestigial REST API config with deprecation notice
- L4: Added warning log for web platform header limitation

Reliability & error handling:
- M2: syncInitialData returns bool (true=success, false=timeout)
- M3: Reconnect concurrency guard with _isReconnecting flag
- M4: Pending requests failed immediately on disconnect()
- M5: Heartbeat watchdog only runs when sendClientPing enabled
- M6: Cache writes have .catchError() handlers
- M9: Room cache race condition fixed with chained futures

Other:
- L1: Test mocks properly used instead of real StorageService
- L2: Uuid used instead of Random() for request IDs
- L3: Not a real issue in Dart's single-threaded model (documented)
- S2: Backend data contracts investigated and documented

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant