Sessions review remediation: coverage, API hardening, docs, and structure#2
Draft
DevAM-Tools wants to merge 3 commits into
Draft
Sessions review remediation: coverage, API hardening, docs, and structure#2DevAM-Tools wants to merge 3 commits into
DevAM-Tools wants to merge 3 commits into
Conversation
TryUnsubscribe now returns false when a JobInfo is not registered in the session job list before treating it as a user job. TryRemoveJob returns false when the job is not found instead of always reporting success. Adds regression tests for foreign and already-removed jobs. Stabilizes TryUnsubscribe_UserJob_CancelsJob by keeping the session in Running phase. Co-authored-by: DevAM <DevAM-Tools@users.noreply.github.com>
…parse helpers - Document event-gated ManualResetEventSlim listener wait loop in class XML - Initialize SpinLock in constructor; remove CA2213 pragma - Add _SourceInfos SnapshotList; GetFrameSources returns CurrentSnapshot without copy - Extract _RegisterListenerSlot for listener registration without CA2000 pragma - Add _TryParseFrameUnderLock for non-throwing reparse in TryGetPacket - Record PacketToFrameMap before PacketStore in source loop - Preserve ownership validation (_ContainsJob, TryRemoveJob, TryUnsubscribe) Co-authored-by: DevAM <DevAM-Tools@users.noreply.github.com>
- Validate TryUnsubscribe and TryRemoveJob ownership (prior commit) - Add Try-parse reparse path and record mapping before store - Remove analyzer suppressions; initialize SpinLock in constructor - Guard job and listener ID generators against overflow - Use SnapshotList for GetFrameSources without per-call allocation - Update ISession and Session XML documentation - Add #region structure to Job and ListenerSlot - Consolidate test wait helpers; add exit-point coverage tests - Document listener notification cost and ThreadWaitHelper usage Co-authored-by: DevAM <DevAM-Tools@users.noreply.github.com>
37bccab to
8ccdec8
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Implements the remaining Sessions review findings on top of ownership validation for
TryUnsubscribeandTryRemoveJob.Production (
NetworkInspector.Sessions)TryUnsubscribe/TryRemoveJobreject foreign or already-removed jobs via_ContainsJob_TryParseFrameUnderLockfor non-throwing reparse inTryGetPacketPacketToFrameMapbeforePacketStore.Storeso mapping capacity failures surface correctlySpinLockin constructor; extract_RegisterListenerSlot; remove CA2213/CA2000 pragmasAllocateJobId/AllocateListenerIdthrowInvalidOperationExceptionatint.MaxValue_SourceInfosasSnapshotList<FrameSourceInfo>;GetFrameSources()returnsCurrentSnapshotTryAddListenerduringRestarting,Shutdowntimeout behavior, listener notification cost,ThreadWaitHelperusage#regionblocks inJobandListenerSlotTests (
NetworkInspector.Sessions.Tests)WaitHelperreplaces duplicated_WaitForConditionhelpersExitPointCoverageTests: reparse mismatch, mapping capacity exceeded, non-indexed parse path, listener ID overflowTryUnsubscribe/TryRemoveJobNotifyFlagsTests:JobRemovedandStackChangedbit-distinctnessAllocateJobId_AtCapacity_ThrowsInvalidOperationExceptionVerification
NetworkInspector.Sessions):exitGapCount == 0,gatePassed: trueNote on PR #1
This branch includes the ownership fixes from
cursor/fix-tryunsubscribe-tryremovejob-ownership-20ab. Consider closing PR #1 in favor of this consolidated PR.