Releases: YBTopaz8/Parse-LiveQueries-DOTNET
v3.4.0
v3.4.0: Enhanced Subscription Management and Refined Error Handling ✨
This release focuses on improving the subscription process and making error handling more informative and consistent. We've refined internal workings to provide a smoother, more predictable LiveQuery experience. This version builds cleanly with no warnings, ensuring a smoother development experience. - Finally! 🫡
Key Improvements:
-
Streamlined Subscription Creation: The
ISubscriptionFactoryhas been updated. TheCreateSubscriptionmethod now includes anunsubscribeActionparameter. This allows for more robust and reliable cleanup when subscriptions are no longer needed. This is a breaking change for anyone with a customISubscriptionFactoryimplementation.// Updated interface: Subscription<T> CreateSubscription<T>(int requestId, ParseQuery<T> query, Action<Subscription> unsubscribeAction) where T : ParseObject;
-
Simplified Unsubscription: The
Subscribemethod withinParseLiveQueryClientnow expertly handles the creation of theunsubscribeAction. This simplifies the subscription process and guarantees correct resource management. AddedSubscriptionExtensionsproviding utility methods for easy unsubscription:UnsubscribeNow()andUnsubscribeAfter(long timeInMinutes). -
More Informative Error Reporting:
- Improved error handling in
ParseObjectandParseUsernow includes detailed exception messages, making it easier to diagnose issues. - Error logging in
WebSocketClientduring connection closure has been enhanced, providing better insights into connection problems. - The
DidEncountermethod withinSubscription<T>benefits from improved error handling, passing the error to the subscription to provide error to users.
- Improved error handling in
-
Internal Enhancements:
TaskQueuehas been refined:TaskQueue.Tailis now guaranteed to be non-nullable.TaskQueue.Enqueuenow returns a non-nullableTask<ParseUser>.
ParseCurrentUserController.currentUseris now non-nullable, reflecting its expected state more accurately.
Breaking Changes:
ISubscriptionFactoryInterface: As mentioned above, theCreateSubscriptionmethod signature has changed. Custom implementations must be updated to include theAction<Subscription> unsubscribeActionparameter.
Upgrade Notes:
- If you have implemented a custom
ISubscriptionFactory, you must update itsCreateSubscriptionmethod to match the new signature. - While this release primarily focuses on internal improvements, thorough testing of your application after upgrading is always recommended.
- Enjoy a more streamlined and informative LiveQuery experience!
Happy Coding! 👍
Full Changelog: v3.2.0...v3.4.0
v3.2.0: Robust LiveQuery Client with Enhanced Reliability and Stability 🚀
Key Enhancements:
-
Automatic Reconnection: Implemented automatic reconnection to the LiveQuery server upon connection loss.
- Features exponential backoff with configurable retries.
- Reports reconnection attempts and failures via the
OnErrorobservable.
-
Heartbeat (Ping/Pong): Integrated WebSocket Ping/Pong frames for robust connection health monitoring.
- Detects and recovers from "dead" connections, enhancing stability.
-
Configurable Receive Buffer: Added ability to customize the WebSocket receive buffer size.
- Useful for handling large messages.
- Utilize:
new WebSocketClient(uri, callback, bufferSize);
-
Refactored WebSocket Handling:
- Complete rewrite for improved stability, error handling, and performance.
- Ensures proper resource disposal (
Dispose()) to prevent memory leaks. - Provides clear and consistent WebSocket connection state management.
- Includes placeholder for binary message handling.
- Allows control over WebSocket close status and description.
-
Optimized Subscription Management:
- Simplified unsubscription process.
- Ensures thread-safe subscription operations.
- Removed reflection for enhanced performance.
-
Full
IDisposableImplementation:ParseLiveQueryClient,WebSocketClient, andSubscriptionclasses now fully implementIDisposable.- Guarantees proper resource cleanup.
-
Enhanced Error Handling: Improved error handling with more informative exceptions and events.
-
Optimized JSON Handling: Enhanced JSON serialization/deserialization.
Breaking Changes:
- None. This release maintains backward compatibility with v3.1.0. Thorough testing is still strongly recommended.
Upgrade Notes:
- Thorough application testing is highly recommended after upgrading due to significant internal improvements.
- New features (reconnection, buffer size) are optional and do not require code changes to maintain existing functionality.
Happy Coding! 👋🏾
Release v3.1.0
Merge branch 'master' of https://github.com/YBTopaz8/parse-live-query-dotnet
Release 3.1.0
Automated release for version 3.1.0
v3.0.2🛠️
Full Changelog: v3.0.1...v3.0.2
v3.0.1🎇
v3.0.0 🎄 - CRITICAL
- Fixed an issues where connected Live Queries would never actually close stream with server (causing memory leaks)
- This eliminates any instance where a "disconnected" user would still be able to receive data from the server and vice versa.
- Please update to this version as soon as possible to avoid any security issues.
- The best I would suggest is to migrate the currently observed classes to a new class and delete the old one.
- You can easily do this by creating a new class and copying the data from the old class to the new one (via ParseCloud in your web interface like in Back4App).
More Fixes...
- Fixed issues where
GetCurrentUIser()from Parse did NOT returnuserNametoo. - Fixed issues with
Relations/Pointersbeing broken.
Thank You for upgrading.
For any issues, please freely open an issue on GitHub
v2.04
What's Changed
v2.0.4
Improvements on base Parse SDK.
- LogOut now works perfectly fine and doesn't crash app anymore!
- SignUpWithAsync() will now return the Signed up user's info to avoid Over querying.
- Renamed some methods.
- Fixed perhaps ALL previous UNITY crashes.
Full Changelog: v2.0...v2.0.4
v3.5.0-release
This is a major release that includes a significant refactor of the underlying WebSocket engine, modernization of the public API to even more async, and the introduction of several key features to improve resilience and developer experience.
💥 BREAKING CHANGES
This version introduces several breaking changes to the public API to align with modern .NET Task-based Asynchronous Patterns (TAP) and improve overall robustness.
- Async Public API: All major lifecycle and communication methods are now fully asynchronous and support
CancellationToken.IWebSocketClient.Open()is nowTask OpenAsync(CancellationToken cancellationToken = default).IWebSocketClient.Close()is nowTask CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken = default).IWebSocketClient.Send(string message)is nowTask SendAsync(string message, CancellationToken cancellationToken = default).
- Client Lifecycle Management: The client's connection lifecycle is now managed explicitly.
- The implicit
ConnectIfNeeded()andReconnect()methods have been replaced by an explicitStart()method to initiate the connection and enable auto-reconnection. - The
Disconnect()method has been replaced byTask StopAsync()to cleanly shut down the client, disconnect, and disable auto-reconnection.
- The implicit
WebSocketClientFactorySignature Change: The delegate signature has been simplified. ThebufferSizeparameter has been removed as it is now managed internally by theWebSocketClient.- Old:
delegate IWebSocketClient WebSocketClientFactory(Uri hostUri, IWebSocketClientCallback cb, int bufferSize) - New:
delegate IWebSocketClient WebSocketClientFactory(Uri hostUri, IWebSocketClientCallback cb)
- Old:
- Event Handling Rerouted: The global
ParseLiveQueryClient.OnObjectEventobservable has been removed. Object events are now routed directly to the specificSubscription<T>instance that they belong to. This provides a more intuitive and type-safe way to handle events. IWebSocketClientCallback.OnClose()Signature Change: TheOnClose()method now provides detailed information about why the connection was closed.- Old:
void OnClose() - New:
void OnClose(WebSocketCloseStatus? status, string description)
- Old:
OnDisconnectedObservable Change: TheOnDisconnectedobservable now emits aDisconnectInforecord, providing richer contextual information (e.g.,CloseStatus,Reason) instead of a simple tuple.
🚀 New Features
- Traditional C# Event Handlers: In addition to the existing
System.Reactive(Rx) observables,Subscription<T>now exposes traditional C# events (OnCreate,OnUpdate,OnDelete,OnEnter,OnLeave) for a more familiar event-driven programming model. Extension methods (.On(...),.OnUpdate(...)) have been added for easy attachment. - Async Disposal:
ParseLiveQueryClientnow implementsIAsyncDisposable. You can now properly await its disposal usingawait using var client = new ParseLiveQueryClient();. - Formal Connection State Machine: The client now exposes a
LiveQueryConnectionStateenum (Disconnected,Connecting,Connected,Reconnecting,Failed) and anOnConnectionStateChangedobservable, providing transparent insight into the client's current status. - Binary Message Support (Preview): The
IWebSocketClientinterface now includes anIObservable<ReadOnlyMemory<byte>> BinaryMessagesstream, laying the groundwork for handling binary data from the server. - Detailed Disconnect Information: The
OnDisconnectedobservable now provides aDisconnectInforecord, which includes the close status and reason, and a flag indicating if the disconnect was user-initiated.
✨ Improvements & Refinements
- WebSocket Engine Overhaul: The
WebSocketClienthas been completely rewritten for superior stability and performance.- Connection Resilience: The connection logic is now managed in a dedicated
ConnectWithRetryAsyncloop with exponential backoff, making it far more resilient to transient network failures. - Centralized State Management: A new
UpdateStatemethod ensures that all state transitions are managed cleanly and broadcast to observers. - Graceful Shutdown: A new
CloseInternalAsyncmethod centralizes shutdown logic, ensuringCancellationTokenSources are cancelled, sockets are closed gracefully, and resources are disposed of correctly, preventing race conditions. - Performance: The receive loop now uses
ArrayPool<byte>.SharedandMemoryStreamto significantly reduce memory allocations and GC pressure during message processing. - Native Keep-Alive: The manual ping/pong mechanism has been replaced by leveraging the native
ClientWebSocket.Options.KeepAliveInterval, simplifying the implementation and reducing network chatter.
- Connection Resilience: The connection logic is now managed in a dedicated
- Thread Safety: The core
ParseLiveQueryClienthas improved thread safety by introducing a_stateLockfor managing its connection state. - Error Propagation: The
TaskQueueWrappernow correctly propagates exceptions fromEnqueueOnSuccesstasks, preventing them from being silently swallowed. - Code Organization: The utility
ObjectMapperhas been removed from theParseLiveQueryClient.csfile, improving separation of concerns.
🐛 Bug Fixes
- Addressed Reconnection Race Conditions: The previous architecture, where reconnection was attempted from within the
ReceiveLoopAsync, could lead to race conditions and an unstable state. The redesigned connection logic inWebSocketClientcompletely resolves this. - Corrected Exception Handling in Task Queue: Ensured that exceptions thrown during the execution of tasks within
EnqueueOnSuccessare no longer suppressed and are properly propagated as anInvalidOperationException. - Improved
DisposePattern: TheDisposelogic inWebSocketClientis now more robust, ensuring all reactive subjects are completed and all resources, including theClientWebSocketandCancellationTokenSources, are properly cleaned up.
v2.0.3
2.0.3 (2024-Dec-11)
What's changed ?
New Features 🚀
-
Introduced Full Support for LINQ
- Querying Parse Live Data now integrates seamlessly with LINQ.
- Enables filtering, projection, and chaining operations directly on queryable objects.
-
Added Rx.NET Integration
- Facilitates reactive programming patterns for Live Queries.
- Subscriptions now support LINQ-like operators for stream composition (e.g., filtering, transforming).
Why LINQ Is Great:
- Offers a familiar and powerful querying syntax for .NET developers.
- Provides better readability and maintainability when working with complex queries.
Why Rx.NET Is Great:
- Reactive streams simplify handling of real-time data and events.
- Operators like
Where,Select, andThrottleallow precise control over data streams.
Changes
-
Removed Callbacks in Favor of Rx.NET:
- Replaced the callback-based event handling model with a fully Rx.NET-powered design.
- This change improves readability and consistency for handling Live Query events.
-
Replaced Asynchronous Tasks with Synchronous Methods:
- Simplifies the usage of the SDK by reducing the complexity of interacting with core operations.
-
Added Support for .NET 5, 6, 7, and 8:
- Extended compatibility to include all major versions of .NET from 5 to 9, along with .NET MAUI.
Breaking Changes
-
Dropped Callback Support:
- Applications using the callback-based model for Live Queries will need to migrate to the new Rx.NET-based design.
-
Modified Task-Based APIs to Synchronous APIs:
- Adjust your codebase to use the new synchronous methods where applicable.
Previous Releases
1.0.0 (2024-Dec-05)
Features
- Introduced support for Parse Live Queries in .NET.
- Targeted .NET 9+ and .NET MAUI.
- Enabled real-time updates for Parse objects with minimal delay.
This changelog communicates what's new, breaking changes, and compatibility updates effectively, setting the stage for your users to upgrade smoothly!