Skip to content

fix(device): contain SafeTrace formatting and document DeviceState.Streaming - #813

Draft
tylerkron wants to merge 1 commit into
mainfrom
cursor/safetrace-streaming-docs-b5a8
Draft

tylerkron wants to merge 1 commit into
mainfrom
cursor/safetrace-streaming-docs-b5a8

Conversation

@tylerkron

Copy link
Copy Markdown
Contributor

Summary

Two hygiene items in src/Daqifi.Core. No public member added or removed.

  • Isolation catches in DaqifiStreamingDevice (RaiseStreamFrameDiscarded, RaiseGapDetected) and AllTransportsDeviceFinder (RaiseIsolated, both SafeDiscoverAsync overloads) interpolated ex before SafeTrace could catch it, so a throwing ToString escaped the catch that exists to contain it. Those five sites now use SafeTrace(Func<string>), the same overload SerialStreamTransport and TcpStreamTransport already use, so formatting stays inside the guard.
  • DeviceState.Streaming stays (shipped; removing it is CP0002). Nothing assigns it: after initialization DaqifiDevice.State remains Ready, and live acquisition is IStreamingDevice.IsStreaming. The enum summary now says that.

DeviceFinderBase (#806) and CompositeMessageParser (#810) are untouched.

Test plan

  • dotnet build src/Daqifi.Core/Daqifi.Core.csproj -c Release — net9.0 and net10.0, 0 warnings
  • CI
Open in Web Open in Cursor 

Switch the five eager SafeTrace($"…{ex}") sites on the stream-event and
discovery isolation catches to the Func<string> overload so a throwing
ToString stays inside the guard.

Document that DeviceState.Streaming is never assigned and that live
acquisition state is IStreamingDevice.IsStreaming.

Co-authored-by: Tyler Kron <tylerkron@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants