instantdb_flutter 0.2.2 copy "instantdb_flutter: ^0.2.2" to clipboard
instantdb_flutter: ^0.2.2 copied to clipboard

A real-time, offline-first database client for Flutter with reactive bindings.

0.2.2 #

๐Ÿš€ Major Fix: Query Result Caching for Datalog Format #

Fixed Critical Issue

  • โœ… Fixed datalog format not being returned as collection format - Applications now receive properly converted collection data instead of raw datalog format
  • โœ… Added query result caching - Converted datalog results are cached for immediate access, solving the "0 documents" issue
  • โœ… Improved data availability - Queries now return cached results immediately after datalog conversion, without waiting for async storage operations

Technical Improvements

  • โœ… Query result cache in SyncEngine - Stores converted collection data from datalog processing
  • โœ… Cache-first query strategy - QueryEngine checks cache before querying storage
  • โœ… Smart cache invalidation - Cache clears when local transactions affect collections
  • โœ… Enhanced query filtering - Apply where, orderBy, limit, and offset to cached data

Architecture Enhancements

  • โœ… Direct data path - Datalog conversion results are immediately available to queries
  • โœ… Reduced latency - No dependency on async storage operations for query results
  • โœ… Better synchronization - Ensures data consistency between datalog processing and query results

๐Ÿ“š Impact #

This release fixes a critical issue where applications using the InstantDB Flutter package would receive 0 documents from queries, even though the package successfully processed datalog internally. The fix ensures that:

  1. Datalog format is properly converted to collection format
  2. Converted data is immediately available to applications
  3. No data loss occurs during the conversion process
  4. Applications no longer need workarounds to parse datalog manually

For AppShell Users: While AppShell v0.7.19+ includes a workaround, updating to InstantDB Flutter v0.2.2 provides the proper fix at the package level.


0.2.1 #

๐Ÿ› Critical Bug Fixes #

Enhanced Datalog Processing

  • โœ… Fixed datalog-result format edge cases - Resolved scenarios where malformed join-rows or unexpected data structures could cause silent failures, leading to empty query results despite data existing in the response
  • โœ… Added robust format detection - Implemented comprehensive datalog format detection that handles multiple variations including nested structures and different datalog path locations
  • โœ… Enhanced error logging - Added detailed logging for unrecognized query response formats to aid debugging instead of failing silently
  • โœ… Multiple fallback paths - Added systematic fallback logic that tries various datalog extraction methods before falling back to simple collection format
  • โœ… Improved delete detection - Better handling of entity deletions across different data formats and connection states

Connection & Timing Improvements

  • โœ… Fixed connection timing race conditions - Resolved timing-dependent format detection failures during connection initialization that could cause datalog responses to be ignored
  • โœ… Enhanced message type handling - Improved processing of different query response message types (add-query-ok, refresh-ok, query-invalidation) with varying data structure expectations
  • โœ… Added explicit failure warnings - Replaced silent failures with explicit warnings when query responses don't match expected formats

๐Ÿ”ง Technical Improvements #

Code Quality

  • โœ… Modularized datalog processing - Refactored datalog handling into focused, testable methods for better maintainability
  • โœ… Enhanced type safety - Improved type checking and reduced unnecessary casts in datalog processing logic
  • โœ… Better error reporting - Added comprehensive logging at different levels to help debug datalog processing issues

Architecture

  • โœ… Robust conversion pipeline - Implemented a systematic approach to converting datalog-result format to collection format with multiple validation points
  • โœ… Improved data flow - Enhanced the data processing pipeline to handle edge cases gracefully while maintaining performance

๐Ÿ“š Documentation #

  • โœ… Updated CLAUDE.md with detailed information about datalog processing improvements
  • โœ… Added documentation for debugging datalog format detection issues

0.2.0 #

๐Ÿš€ Major Features - React/JS SDK Feature Parity #

New Transaction System (tx namespace)

  • โœ… Added fluent tx namespace API for cleaner transactions (db.tx['entity'][id].update({}))
  • โœ… Implemented transactChunk() method for transaction chunks
  • โœ… Added merge() operation for deep nested object updates
  • โœ… Added link() and unlink() operations for entity relationships
  • โœ… Implemented lookup() references to reference entities by attributes instead of IDs

Advanced Query Operators

  • โœ… Added comparison operators: $gt, $gte, $lt, $lte, $ne
  • โœ… Added string pattern matching: $like, $ilike with wildcard support
  • โœ… Added array operations: $contains, $size, $in, $nin
  • โœ… Added existence operators: $exists, $isNull
  • โœ… Enhanced logical operators: improved $and, $or, $not support

Room-based Presence System

  • โœ… Added joinRoom() API returning scoped InstantRoom instances
  • โœ… Implemented room-specific presence operations (scoped to individual rooms)
  • โœ… Added topic-based pub/sub messaging with publishTopic() and subscribeTopic()
  • โœ… Complete room isolation - presence data separated between rooms
  • โœ… Backward compatible with existing direct room ID APIs

API Improvements

  • โœ… Added subscribeQuery() alias for reactive queries (matches React SDK)
  • โœ… Implemented queryOnce() for one-time query execution
  • โœ… Added getAuth() and subscribeAuth() convenience methods
  • โœ… Improved error handling and validation

๐Ÿงช Testing & Quality #

  • โœ… 150 total tests passing (up from 118 tests)
  • โœ… Added comprehensive test suite for all new features
  • โœ… Performance testing for large datasets and query caching
  • โœ… Room-based presence system testing with isolation validation

๐Ÿ› Bug Fixes & Performance Improvements #

  • โœ… Fixed transaction conversion for real-time sync - transactions now properly convert to tx-steps with actual data instead of sending 0 steps
  • โœ… Fixed duplicate entity issue during sync - implemented deduplication logic to prevent locally-created entities from being re-applied during refresh-ok
  • โœ… Fixed entity type resolution during sync - entities from server now properly stored with correct type (e.g., todos:id instead of unknown:id)
  • โœ… Fixed delete synchronization between instances - implemented differential sync to detect and apply deletions when entities are missing from server responses, including handling empty entity lists
  • โœ… Fixed presence reactions not appearing in peer instances - implemented proper refresh-presence message handling to convert reaction data to visible UI reactions
  • โœ… Fixed cursors, typing indicators, and avatars not working in peer instances - implemented complete presence data detection and routing in refresh-presence messages to handle all presence types
  • โœ… Fixed avatars page showing only 1 user instead of both users - preserved local user's presence when processing refresh-presence messages to match React SDK behavior
  • โœ… Fixed avatar presence data extraction and room ID consistency - corrected nested data structure extraction from refresh-presence messages and unified room key format usage
  • โœ… Fixed typing indicators showing 'Someone' instead of actual user names - updated typing page to set initial presence with userName and display actual user names in typing indicators
  • โœ… Added comprehensive hierarchical logging system - using logging package for better debugging and monitoring of sync operations
  • โœ… Enhanced sync engine with proper attribute UUID mapping - transactions now use correct InstantDB attribute UUIDs instead of attribute names

๐Ÿ“– Documentation #

  • โœ… Updated README with all new APIs and examples
  • โœ… Created ADVANCED_FEATURES.md comprehensive feature guide
  • โœ… Added MIGRATION_GUIDE.md for upgrading existing code
  • โœ… Updated example applications showcasing new room-based presence APIs

๐Ÿ“ฑ Example Applications Updated #

  • โœ… Cursors demo updated to use room-based presence API
  • โœ… Reactions demo updated with room-scoped reactions
  • โœ… Typing indicators demo updated with room-scoped typing
  • โœ… Avatars demo updated with room-scoped presence
  • โœ… Todos demo updated to showcase new tx namespace API

๐Ÿ”ง Breaking Changes #

None! This release is fully backward compatible. All existing APIs continue to work.

๐ŸŽฏ Migration Path #

  • Immediate: New projects can use new APIs from day one
  • Gradual: Existing projects can migrate incrementally at their own pace
  • Optional: Migration provides better performance and developer experience but is not required

0.1.2 #

๐Ÿ“š Documentation & Web Support #

  • Added web platform setup documentation with SQLite web worker configuration
  • Added documentation link to pub.dev pointing to https://instantdb-flutter-docs.pages.dev
  • Improved setup instructions to prevent web worker initialization errors

0.1.1 #

๐Ÿ”ง Fixes #

0.1.0 #

๐ŸŽ‰ Initial Release #

Core Features

  • โœ… Real-time synchronization with InstantDB backend
  • โœ… Offline-first local storage with SQLite triple store
  • โœ… Reactive UI updates using Signals
  • โœ… InstaQL query language support
  • โœ… Transaction system with optimistic updates
  • โœ… Authentication system integration
  • โœ… Schema validation and type safety

Flutter Integration

  • โœ… InstantProvider for dependency injection
  • โœ… InstantBuilder and InstantBuilderTyped reactive widgets
  • โœ… AuthBuilder for authentication state management
  • โœ… Watch widget for reactive UI updates
  • โœ… ConnectionStatusBuilder for network status

Presence System

  • โœ… Real-time cursor tracking
  • โœ… Typing indicators
  • โœ… Emoji reactions
  • โœ… User presence status
  • โœ… Room-based collaboration features

Developer Experience

  • โœ… Comprehensive example application
  • โœ… Full test coverage
  • โœ… TypeScript-style API design
  • โœ… Hot reload support
  • โœ… Debug tooling integration

0.0.1 #

  • Initial development release with basic InstantDB integration
8
likes
0
points
85
downloads

Publisher

unverified uploader

Weekly Downloads

A real-time, offline-first database client for Flutter with reactive bindings.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

crypto, dio, flutter, flutter_dotenv, json_annotation, logging, path, signals_flutter, sqflite, sqflite_common_ffi_web, uuid, web_socket_channel

More

Packages that depend on instantdb_flutter