dart_meteor 4.1.0
dart_meteor: ^4.1.0 copied to clipboard
This library make connection between meteor backend and flutter app easily. Design to work seamlessly with StreamBuilder and FutureBuilder.
4.1.0 #
Connection lifecycle fixes. The theme is a device that goes to sleep: the process is suspended, timers stop, and the server drops the session without the socket ever reporting an error.
Fixed:
- A missed
pongleft the client permanently offline. The pong timeout calleddisconnect(), which also disabled reconnection, so no retry was ever scheduled — the exact path a device takes when it wakes with a stale socket. - Reconnect backoff never engaged.
retryCountwas reset on every connection attempt, so the computed interval was always 0s andmaxRetryCountwas never reached, producing a tight reconnect loop. The counter is now reset only once the server accepts the connection. - Connecting to an unreachable server raised an unhandled exception that
could terminate the application, because
WebSocketChannel.connectfails asynchronously rather than throwing. The client now awaitsreadyand routes the failure into its normal retry path. - A method call that was in flight when the connection dropped never completed.
Pending calls are now completed with the new
MeteorConnectionError. - Subscriptions were re-sent before the login token was resumed, so
publications depending on
this.userIdre-ran unauthenticated after every reconnect. Re-subscription now waits for theonReconnectcallbacks. disconnect()did not cancel a pending reconnect timer, so an explicit disconnect could be undone by a retry that was already scheduled.status()emitted the client's own mutable status object, so a fast transition could be misread by subscribers. Each event is now a snapshot.
Added:
meteor.notifyAppPaused()/meteor.notifyAppResumed()andmeteor.checkLiveness(). On resume the client compares the wall clock against the last message received and replaces a stale connection immediately, instead of waiting for a ping to time out. The package stays pure Dart; the FlutterWidgetsBindingObserverglue is a few lines shown in the README and inexample/.- Configurable
pingInterval,pongTimeout,maxRetryIntervalandstalenessThresholdonMeteorClient.connectandDdpClient. test/lifecycle_test.dart, a server-free regression suite for the above; the mock DDP server moved totest/mock_ddp_server.dartso both suites share it.
Behaviour changes to be aware of when upgrading:
await meteor.call(...)can now throwMeteorConnectionErrorwhere it previously hung forever. In-flight calls are not retried automatically, since methods are not necessarily idempotent.- Reconnect attempts are spaced out rather than immediate.
onReconnectcallbacks may now return aFuture, which is awaited before subscriptions are re-sent.
4.0.0 #
- Support for the latest Dart/Flutter releases (tested with Dart 3.13). The minimum SDK is now Dart 3.6.
- Verified compatibility with Meteor 3.x servers, including Meteor 3.5.1 (DDP protocol version 1, SHA-256 password login, EJSON
$datehandling). - Web platform support from the 4.0.0 betas via
web_socket_channelis included. - Added a standalone DDP protocol test suite (
test/ddp_mock_server_test.dart) that runs without a Meteor server or docker. - Updated dependencies and lint rules (
lints6). - BREAKING:
DdpClient.PING_SEC_INTERVALandDdpClient.PONG_WITHIN_SECwere renamed to the static constantsDdpClient.pingIntervalSecondsandDdpClient.pongTimeoutSeconds.
4.0.0-beta.1, 4.0.0-beta.2 #
- Adding Web platform support by using the
web_socket_channel.
3.0.0 #
- BREAKING CHANGE. The
meteor.collection('collectionName')streams are nowhasData == trueand have an empty map at the beginning.
2.1.4 #
- Acessing to serverId and sessionId
2.1.3 #
- Resend subscription packets on reconnection.
2.1.2 #
- Return MeteorClientLoginResult on logoutOtherClients.
2.1.1 #
- Return null if no current value presents for the 'currentValue'.
2.1.0 #
- Fix a major bug on escaping DateTime when doing method call and subscribe.
2.0.4 #
- Fix bug on meteor.user() does not set back to null after user has been logged out.
2.0.3 #
- Separated login function.
2.0.2 #
- Fix bugs on connecting to Meteor 2.x.x and on logout function.
2.0.1 #
- Fix a $date bug when parsing an array result from methods/collections.
2.0.0 #
- Null safety and some API changes.
1.1.2 #
- Lower crypto package version to match the flutter_test.
1.1.1 #
- Allows both int and String for MeteorError.error
1.1.0 #
- Pin rxdart to 0.24.1 and crypto to 2.1.5.
1.0.8 #
- Allow passing email to loginWithPassword.
1.0.7 #
- Don't use this release
1.0.5 1.0.6 #
- Pin rxdart version to 0.22.6
1.0.1 1.0.4 #
- Update README and example
1.0.0 1.0.3 #
- Initial version.