Skip to content

v0.2.8 - Complete Signal Batching Implementation

Choose a tag to compare

@pillowsoft pillowsoft released this 02 Jan 18:53
· 10 commits to main since this release

πŸ› Critical Bug Fix - Complete Signal Batching Implementation

BREAKING FIX: v0.2.7's signal batching was incomplete. This release completes the fix by adding batch() to all 14 missing locations.

What was fixed:

  • βœ… sync_engine.dart - 6 connection status updates (CRITICAL)
    • stop(), init-ok handler, init-error handler, auth error, websocket error, websocket close
    • Impact: Prevents SignalEffectException during network reconnection/errors
  • βœ… presence.dart - 5 presence methods (HIGH)
    • setPresence(), updateCursor(), removeCursor(), setTyping(), sendReaction()
    • Impact: Fixes reactive cycles in multi-user collaboration features
  • βœ… auth_manager.dart - 2 missing auth methods (HIGH)
    • refreshUser(), updateUser()
    • Impact: Completes the v0.2.7 auth fix (only 6 of 8 methods were batched)
  • βœ… query_engine.dart - 1 query execution pattern (MEDIUM)
    • _executeQuery() success and error signal updates
    • Impact: Prevents reactive cycles during rapid query updates

Why this matters:

  • v0.2.7 claimed "Added batch() calls to all auth methods" but only batched 6 of 8 auth methods
  • Entire modules (sync_engine, presence) were completely unbatched
  • Connection state changes during network issues would still trigger SignalEffectException
  • Multi-user presence features could cause reactive cycles

Total fixes: 14 unbatched signal updates across 5 files

Technical Details:

// ❌ Before: Unbatched signal update (causes reactive cycles)
_connectionStatus.value = false;

// βœ… After: Properly batched
batch(() {
  _connectionStatus.value = false;
});

Files changed:

  • lib/src/sync/sync_engine.dart - 6 fixes
  • lib/src/reactive/presence.dart - 5 fixes
  • lib/src/auth/auth_manager.dart - 2 fixes
  • lib/src/query/query_engine.dart - 1 fix

Verification:

  • βœ… All 144 existing tests passing
  • βœ… No new linting issues
  • βœ… No API changes - fully backward compatible

Full Changelog: v0.2.7...v0.2.8