dart_faye 1.2.5
dart_faye: ^1.2.5 copied to clipboard
A complete Dart implementation of Faye, a publish-subscribe messaging system that implements the Bayeux protocol.
Changelog #
1.2.5 #
Bug Fixes #
- Transport Stability: Fixed critical issue where client would auto-switch transports after handshake
- Removed automatic transport switching based on server
supportedConnectionTypes
- Client now maintains user-selected transport throughout the session
- Prevents "No URL configured" errors when connect cycle uses wrong transport
- Resolves subscription failures caused by transport mismatch
- Removed automatic transport switching based on server
- HTTP Transport State Management: Fixed HTTP transport connection state handling
- Changed
send()
andsendBatch()
to check for URL configuration instead of boolean connected state - HTTP transport now correctly handles stateless nature vs WebSocket persistent connection
- Eliminates false "Not connected" errors during normal operation
- Aligns with HTTP's request-response model vs WebSocket's persistent connection model
- Changed
Technical Improvements #
- Transport Architecture: Improved separation of concerns between transport and protocol layers
- HTTP transport focuses purely on HTTP communication without Bayeux protocol logic
- WebSocket transport handles raw WebSocket communication
- Dispatcher centralizes all Bayeux protocol handling
- Client manages connection lifecycle and state transitions
- Connection Stability: Enhanced connection reliability and error handling
- Better handling of transport-specific connection requirements
- Improved error messages for debugging transport issues
- More robust connection state management
1.2.4 #
Documentation & Examples #
- Pub.dev Compliance: Restructured example directory to follow pub.dev best practices
- Moved examples to
example/lib/
directory structure - Created
example/lib/main.dart
as primary example for pub.dev display - Added
example/README.md
for pub.dev Example tab - Created
example/pubspec.yaml
for proper dependency management - All examples now use
package:dart_faye/dart_faye.dart
imports
- Moved examples to
- Enhanced Examples: Added comprehensive example suite
- Main Example: Complete demonstration of client setup, subscriptions, publishing, and error handling
- Offline Demo: API demonstration without requiring server connection
- Basic Client: Simple connection and messaging example
- Chat Application: Interactive multi-room chat functionality
- Extension Example: Authentication and custom message processing
- WebSocket Enhanced: Advanced transport and pattern matching features
- Improved Documentation: Enhanced example documentation and usage instructions
- Added detailed feature demonstrations with code examples
- Included server setup instructions for testing
- Added configuration and error handling guidance
- Provided next steps for building real-time applications
Testing & Quality Assurance #
- Reconnection Bug Analysis: Comprehensive analysis of server advice handling and automatic reconnection
- Created
test/reconnection_test.dart
with 23 tests documenting current behavior - Identified 6 critical bugs in reconnection and advice handling:
- Missing automatic reconnection logic for
retry
andhandshake
advice - Missing client ID expiration handling (402 errors)
- Missing subscription restoration after reconnection
- Missing error-triggered reconnection
- Missing transport-level reconnection
- Missing state management during reconnection
- Missing automatic reconnection logic for
- Documented expected vs. current behavior for all reconnection scenarios
- Provided detailed bug reports with code locations and recommended fixes
- Created test coverage for advice processing, state management, and error handling
- Created
Technical Improvements #
- Example Structure: Proper Dart package structure for examples
- Independent
pubspec.yaml
with local dependency reference - Correct import statements following pub.dev guidelines
- Comprehensive offline demo showing API without server requirements
- Enhanced error handling demonstrations
- Transport management and configuration examples
- Independent
Bug Documentation #
- Reconnection Issues: Documented current limitations in automatic reconnection
- Client doesn't implement automatic reconnection based on server advice
- No handling of client ID expiration requiring re-handshake
- Subscriptions not automatically restored after reconnection
- Network errors don't trigger reconnection attempts
- Transport disconnections don't trigger client-level reconnection
- State management doesn't account for reconnection attempts
1.2.3 #
Bug Fixes #
- Dispatcher Type Check: Fixed unnecessary type check warning in dispatcher's
_sendMessage
method- Removed redundant type check that was flagged by the Dart analyzer
- Improved code quality and eliminated linter warnings
Dependency Updates #
- Package Cleanup: Removed unused dependencies and updated to latest versions
- Removed unused
crypto
,convert
, andjson_annotation
dependencies from core package - Updated
http
from ^1.1.0 to ^1.2.0 - Updated
web_socket_channel
from ^2.4.0 to ^3.0.3 - Updated
uuid
from ^4.0.0 to ^4.3.3 - Updated
meta
from ^1.9.0 to ^1.12.0 - Updated
lints
from ^3.0.0 to ^6.0.0 - Moved
crypto
andconvert
to dev_dependencies for test scripts
- Removed unused
Technical Improvements #
- Reduced package size by removing unused dependencies
- Improved dependency management and version compatibility
- Enhanced code quality with latest linter rules
1.2.2 #
Bug Fixes #
- Bayeux Response Handling: Fixed critical bug where the package failed to handle Bayeux protocol responses that come as JSON arrays
- Added
extractBayeuxMessage()
helper function to handle both single object and array responses - Updated HTTP transport, Client, and Dispatcher to properly handle array responses
- Fixed "type 'String' is not a subtype of type 'int' of 'index'" error when accessing response properties
- Enhanced HTTP transport's
send()
method to properly handle responses for immediate requests - Added comprehensive tests for Bayeux response handling scenarios
- Made the package compatible with servers that return responses in the standard Bayeux array format
- Added
Technical Improvements #
- Added helper functions for consistent Bayeux response handling across all components
- Enhanced error handling for empty arrays and invalid response types
- Improved compatibility with various Bayeux server implementations
- Added test coverage for response handling edge cases
1.2.0 #
Features #
- Enhanced Extension Support: Improved extension processing for both incoming and outgoing messages
- Extension processing now applied to incoming messages in Client
- Better error handling and logging for extension operations
- Extension type and method availability logging for debugging
- Improved Subscription State Management: Enhanced subscription handling during connection phases
- Allow subscriptions during connecting state (not just connected state)
- Better support for extensions that need to subscribe during handshake response processing
- More robust state validation for subscription operations
Bug Fixes #
- Extension Access: Added proper extension getter in Dispatcher for Client access
- Message Processing: Fixed extension processing in incoming message handling
- State Management: Improved connection state handling for subscription operations
Technical Improvements #
- Enhanced logging for extension operations and debugging
- Better error handling in extension processing
- Improved state validation for subscription operations
- More comprehensive extension integration throughout the message flow
1.1.0 #
Features #
- Extension Support: Added support for Faye extensions to enable authentication and message transformation
- New
setExtension()
method on Client and Dispatcher classes - Extension processing in outgoing messages for authentication headers
- Support for custom extension classes implementing
outgoing()
andincoming()
methods
- New
- Comprehensive Logging: Added extensive logging throughout the package for debugging
- Logger integration in Client, Dispatcher, and Transport classes
- Detailed connection state tracking and error reporting
- Debug information for message processing and extension handling
- Improved WebSocket Transport: Enhanced WebSocket transport reliability
- Better handling of batch messages (arrays) from server responses
- Improved connection order (transport connection before handshake)
- Automatic transport selection for WebSocket URLs (wss://, ws://)
- Removed protocol restrictions to allow server protocol selection
Bug Fixes #
- Connection Order: Fixed dispatcher to connect transport before handshake
- State Constants: Corrected state constant usage (integer values instead of enum-like constants)
- Message Processing: Fixed extension message processing to ensure modified messages are returned
- Batch Message Handling: Added support for server responses in array format
- Transport Selection: Improved automatic transport selection logic
Technical Improvements #
- Enhanced error handling and debugging capabilities
- Better integration with Flutter applications
- Improved authentication flow with extension support
- More robust connection management
1.0.0 #
Features #
- Complete Dart implementation of Faye publish-subscribe messaging system
- Bayeux protocol compliance with channel validation and pattern matching
- HTTP transport support (long-polling and callback-polling)
- WebSocket transport with automatic reconnection and heartbeat
- Channel pattern matching with wildcards (
*
and**
) - Subscription management with callbacks
- Publication tracking and error handling
- Comprehensive error types (network, timeout, protocol, authentication, etc.)
- Utility classes for channel namespaces and validation
- Stream-based API for reactive programming
- Flutter compatibility
Technical Details #
- Dart SDK: >=3.0.0
- Flutter: >=3.0.0
- Dependencies: http, web_socket_channel, crypto, uuid, logging, json_annotation
- All tests passing (38 tests)
- MIT License