Skip to content

Releases: YBTopaz8/Parse-LiveQueries-DOTNET

v3.4.0

06 Mar 16:25

Choose a tag to compare

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 ISubscriptionFactory has been updated. The CreateSubscription method now includes an unsubscribeAction parameter. This allows for more robust and reliable cleanup when subscriptions are no longer needed. This is a breaking change for anyone with a custom ISubscriptionFactory implementation.

    // Updated interface:
    Subscription<T> CreateSubscription<T>(int requestId, ParseQuery<T> query, Action<Subscription> unsubscribeAction) where T : ParseObject;
  • Simplified Unsubscription: The Subscribe method within ParseLiveQueryClient now expertly handles the creation of the unsubscribeAction. This simplifies the subscription process and guarantees correct resource management. Added SubscriptionExtensions providing utility methods for easy unsubscription: UnsubscribeNow() and UnsubscribeAfter(long timeInMinutes).

  • More Informative Error Reporting:

    • Improved error handling in ParseObject and ParseUser now includes detailed exception messages, making it easier to diagnose issues.
    • Error logging in WebSocketClient during connection closure has been enhanced, providing better insights into connection problems.
    • The DidEncounter method within Subscription<T> benefits from improved error handling, passing the error to the subscription to provide error to users.
  • Internal Enhancements:

    • TaskQueue has been refined:
      • TaskQueue.Tail is now guaranteed to be non-nullable.
      • TaskQueue.Enqueue now returns a non-nullable Task<ParseUser>.
    • ParseCurrentUserController.currentUser is now non-nullable, reflecting its expected state more accurately.

Breaking Changes:

  • ISubscriptionFactory Interface: As mentioned above, the CreateSubscription method signature has changed. Custom implementations must be updated to include the Action<Subscription> unsubscribeAction parameter.

Upgrade Notes:

  • If you have implemented a custom ISubscriptionFactory, you must update its CreateSubscription method 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 🚀

04 Mar 16:34
490c78e

Choose a tag to compare

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 OnError observable.
  • 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 IDisposable Implementation: ParseLiveQueryClient, WebSocketClient, and Subscription classes now fully implement IDisposable.

    • 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

04 Mar 16:19

Choose a tag to compare

Release 3.1.0

02 Feb 21:00
e32b0c2

Choose a tag to compare

Automated release for version 3.1.0

v3.0.2🛠️

05 Jan 22:00

Choose a tag to compare

Full Changelog: v3.0.1...v3.0.2

v3.0.1🎇

05 Jan 18:43

Choose a tag to compare

V3.0.1 - QOL update

It's no longer REQUIRED to be logged in order to connect to LQ.

Any client device can connect to Live Queries independently

  • Fixed #8 (saves dates as string for now instead of just not saving)
  • Fixed #4
  • Closes #7 too

v3.0.0 🎄 - CRITICAL

23 Dec 13:10
f44457f

Choose a tag to compare

  • 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 return userName too.
  • Fixed issues with Relations/Pointers being broken.

Thank You for upgrading.
For any issues, please freely open an issue on GitHub

v2.04

17 Dec 09:07
743b5f6

Choose a tag to compare

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

26 Aug 01:00

Choose a tag to compare

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 now Task OpenAsync(CancellationToken cancellationToken = default).
    • IWebSocketClient.Close() is now Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken = default).
    • IWebSocketClient.Send(string message) is now Task SendAsync(string message, CancellationToken cancellationToken = default).
  • Client Lifecycle Management: The client's connection lifecycle is now managed explicitly.
    • The implicit ConnectIfNeeded() and Reconnect() methods have been replaced by an explicit Start() method to initiate the connection and enable auto-reconnection.
    • The Disconnect() method has been replaced by Task StopAsync() to cleanly shut down the client, disconnect, and disable auto-reconnection.
  • WebSocketClientFactory Signature Change: The delegate signature has been simplified. The bufferSize parameter has been removed as it is now managed internally by the WebSocketClient.
    • Old: delegate IWebSocketClient WebSocketClientFactory(Uri hostUri, IWebSocketClientCallback cb, int bufferSize)
    • New: delegate IWebSocketClient WebSocketClientFactory(Uri hostUri, IWebSocketClientCallback cb)
  • Event Handling Rerouted: The global ParseLiveQueryClient.OnObjectEvent observable has been removed. Object events are now routed directly to the specific Subscription<T> instance that they belong to. This provides a more intuitive and type-safe way to handle events.
  • IWebSocketClientCallback.OnClose() Signature Change: The OnClose() method now provides detailed information about why the connection was closed.
    • Old: void OnClose()
    • New: void OnClose(WebSocketCloseStatus? status, string description)
  • OnDisconnected Observable Change: The OnDisconnected observable now emits a DisconnectInfo record, 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: ParseLiveQueryClient now implements IAsyncDisposable. You can now properly await its disposal using await using var client = new ParseLiveQueryClient();.
  • Formal Connection State Machine: The client now exposes a LiveQueryConnectionState enum (Disconnected, Connecting, Connected, Reconnecting, Failed) and an OnConnectionStateChanged observable, providing transparent insight into the client's current status.
  • Binary Message Support (Preview): The IWebSocketClient interface now includes an IObservable<ReadOnlyMemory<byte>> BinaryMessages stream, laying the groundwork for handling binary data from the server.
  • Detailed Disconnect Information: The OnDisconnected observable now provides a DisconnectInfo record, which includes the close status and reason, and a flag indicating if the disconnect was user-initiated.

✨ Improvements & Refinements

  • WebSocket Engine Overhaul: The WebSocketClient has been completely rewritten for superior stability and performance.
    • Connection Resilience: The connection logic is now managed in a dedicated ConnectWithRetryAsync loop with exponential backoff, making it far more resilient to transient network failures.
    • Centralized State Management: A new UpdateState method ensures that all state transitions are managed cleanly and broadcast to observers.
    • Graceful Shutdown: A new CloseInternalAsync method centralizes shutdown logic, ensuring CancellationTokenSources are cancelled, sockets are closed gracefully, and resources are disposed of correctly, preventing race conditions.
    • Performance: The receive loop now uses ArrayPool<byte>.Shared and MemoryStream to 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.
  • Thread Safety: The core ParseLiveQueryClient has improved thread safety by introducing a _stateLock for managing its connection state.
  • Error Propagation: The TaskQueueWrapper now correctly propagates exceptions from EnqueueOnSuccess tasks, preventing them from being silently swallowed.
  • Code Organization: The utility ObjectMapper has been removed from the ParseLiveQueryClient.cs file, 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 in WebSocketClient completely resolves this.
  • Corrected Exception Handling in Task Queue: Ensured that exceptions thrown during the execution of tasks within EnqueueOnSuccess are no longer suppressed and are properly propagated as an InvalidOperationException.
  • Improved Dispose Pattern: The Dispose logic in WebSocketClient is now more robust, ensuring all reactive subjects are completed and all resources, including the ClientWebSocket and CancellationTokenSources, are properly cleaned up.

v2.0.3

11 Dec 14:44
85c9fe6

Choose a tag to compare

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:

  1. Offers a familiar and powerful querying syntax for .NET developers.
  2. Provides better readability and maintainability when working with complex queries.

Why Rx.NET Is Great:

  1. Reactive streams simplify handling of real-time data and events.
  2. Operators like Where, Select, and Throttle allow 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!