You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contains only WebSocket-specific work extracted semantically from the former mixed branch.
Included
WebSocket subscription cleanup and lifecycle synchronization.
Incremental payload transport and terminal error preservation.
WebSocket error sanitization/deduplication and focused serialization tests.
Review scope
Please review only WebSocket transport, subscription lifecycle, and WebSocket payload/error serialization. The response-data contract is in #611, and generic streaming/middleware fixes are in #612. Those areas should not be reviewed again here.
If one subscription's unsubscribe action or Dispose throws, Seq.iter stops here and the remaining snapshot entries are never disposed. Because the dictionary was already cleared, those subscriptions cannot be recovered on a later cleanup, leaking active streams on disconnect; cleanup should dispose every entry independently while preserving/reporting failures.
The new finally is the primary protection against leaking active subscriptions when the receive loop exits, but the changed test set has no WebSocket middleware regression test for disconnect/request cancellation or the synchronous Subscribe completion/throw races this PR fixes. Add coverage that asserts every registered subscription is disposed and its id is released on those paths.
The new ValueNone branch is not exercised by the added test, which only resolves ValueSome. This branch is the nullable contract and should be verified through execution (including a streamed or deferred request) so a regression cannot turn a missing sequence into an enumerable/type error instead of GraphQL null.
Add the WebSocket-specific transport, subscription lifecycle, and
payload/error serialization changes on top of the generic streaming
and data-contract fixes: the SubscriptionExecutionResult.Data contract
change to obj voption Skippable and related lifecycle handling in
Shared/WebSockets.fs; GraphQLSubscriptionsManagement.fs subscription
bookkeeping; the ObservableErrorHandling sanitization/deduplication
module and remaining lifecycle/serialization changes in
GraphQLWebsocketMiddleware.fs; the RELEASE_NOTES.md entry documenting
the SubscriptionExecutionResult.Data change; and the new/updated
WebSocket wire-format and error-sanitization tests in
SerializationTests.fs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Introduced `vtryItem` for Seq, List, and Array to provide ValueOption-based safe indexing.
* Updated tryGetPathItemIndex to use `List.vtryItem` for improved safety and consistency.
* Replaced `Seq.choose` with `Seq.vchoose` in `splitBatch`.
* Added `InternalsVisibleTo` for `FSharp.Data.GraphQL.Server.AspNetCore` in the shared project.
Sanitizing before logging removes the original backend message and exception from server-side diagnostics. The client should receive the sanitized list, but the trusted server log should retain problemDetails, as the other exception paths in this middleware do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Contains only WebSocket-specific work extracted semantically from the former mixed branch.
Included
Review scope
Please review only WebSocket transport, subscription lifecycle, and WebSocket payload/error serialization. The response-data contract is in #611, and generic streaming/middleware fixes are in #612. Those areas should not be reviewed again here.
Dependency chain: #611 → #612 → this PR → #609.
Verification
Relevant projects build successfully; the full unit suite passed (663 passed, 5 pre-existing skips).
git diff --checkis clean.