Skip to content

Conversation

@pacmancoder
Copy link
Contributor

@pacmancoder pacmancoder commented Nov 25, 2025

This PR adds new messages for the current active windows tracking.

Issue: ARC-353

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive window recording support to the NOW protocol (version 1.5), enabling tracking of active window changes and title updates across the remote session. The implementation includes new protocol messages, capability flags, and full integration into both Rust and .NET libraries with corresponding test coverage.

  • Introduces three new session messages: WindowRecStart, WindowRecStop, and WindowRecEvent for controlling and receiving window recording events
  • Updates protocol version from 1.4 to 1.5 and adds the WINDOW_RECORDING capability flag
  • Provides complete implementations in Rust (now-proto-pdu) and .NET (Devolutions.NowProto) with handlers and CLI examples

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
rust/now-proto-pdu/src/session/window_rec_start.rs Implements WindowRecStart message with polling interval and title tracking flag
rust/now-proto-pdu/src/session/window_rec_stop.rs Implements WindowRecStop message to terminate window recording
rust/now-proto-pdu/src/session/window_rec_event.rs Implements WindowRecEvent message with three event types: active window, title changed, and no active window
rust/now-proto-pdu/src/session/mod.rs Integrates new window recording messages into session message enum and routing
rust/now-proto-pdu/src/channel/capset.rs Adds WINDOW_RECORDING capability flag and updates protocol version to 1.5
rust/now-proto-testsuite/tests/proto/session.rs Adds comprehensive roundtrip tests for all window recording messages
rust/now-proto-testsuite/tests/proto/channel.rs Updates expected byte sequences for capability tests due to version bump
dotnet/Devolutions.NowProto/src/SessionMessageKind.cs Adds window recording message kind enumerations
dotnet/Devolutions.NowProto/src/NowProtoVersion.cs Updates protocol version to 1.5
dotnet/Devolutions.NowProto/src/Messages/NowMsgSessionWindowRecStart.cs .NET implementation of window recording start message
dotnet/Devolutions.NowProto/src/Messages/NowMsgSessionWindowRecStop.cs .NET implementation of window recording stop message
dotnet/Devolutions.NowProto/src/Messages/NowMsgSessionWindowRecEvent.cs .NET implementation of window recording event message with event data types
dotnet/Devolutions.NowProto/src/Messages/NowMsgRdmCapabilities.cs Fixes timestamp documentation from signed to unsigned representation
dotnet/Devolutions.NowProto/src/Exceptions/NowDecodeException.cs Adds error kind for invalid window recording event flags
dotnet/Devolutions.NowProto/src/Capabilities/NowCapabilitySession.cs Adds WindowRecording capability flag to session capabilities
dotnet/Devolutions.NowProto.Tests/src/MsgSession.cs Adds comprehensive tests for window recording messages
dotnet/Devolutions.NowProto.Tests/src/MsgChannel.cs Updates expected bytes for capability tests
dotnet/Devolutions.NowClient/src/Worker/WorkerCtx.cs Adds window recording event handler registration and message routing
dotnet/Devolutions.NowClient/src/Worker/CommandSetWindowRecEventHandler.cs Command to set window recording event handler
dotnet/Devolutions.NowClient/src/Worker/CommandSessionWindowRecStart.cs Command to start window recording
dotnet/Devolutions.NowClient/src/Worker/CommandSessionWindowRecStop.cs Command to stop window recording
dotnet/Devolutions.NowClient/src/NowClient.cs Public API methods for window recording control with capability checks
dotnet/Devolutions.NowClient/src/IWindowRecEventHandler.cs Interface for handling window recording events
dotnet/Devolutions.NowClient.Cli/Program.cs CLI commands and example handler for window recording
docs/NOW-spec.md Protocol specification for window recording messages and version history update

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

catch (Exception ex)
{
// Rethrow critical exceptions
if (ex is OutOfMemoryException || ex is StackOverflowException || ex is ThreadAbortException)
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ThreadAbortException has been obsolete since .NET Core 2.0+ and .NET 5+. It's not thrown in modern .NET runtimes. This check should be removed to modernize the code and align with current .NET best practices.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Feel free to address the nits found by Copilot and merge 👍

Copy link

Copilot AI commented Dec 2, 2025

@pacmancoder I've opened a new pull request, #54, to work on those changes. Once the pull request is ready, I'll request review from you.

pacmancoder added a commit that referenced this pull request Dec 2, 2025
Addresses review feedback from #52 to remove `ThreadAbortException`
checks, which are obsolete in .NET Core 2.0+ and .NET 5+.

- Removed `ThreadAbortException` from critical exception checks in
`ExecuteRdmActionCommand` and `ExecuteWindowRecStartCommand`

```csharp
// Before
if (ex is OutOfMemoryException || ex is StackOverflowException || ex is ThreadAbortException)

// After
if (ex is OutOfMemoryException || ex is StackOverflowException)
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pacmancoder <3994505+pacmancoder@users.noreply.github.com>
@pacmancoder pacmancoder force-pushed the feat/window-monitoring branch from ac94040 to 8abd281 Compare December 2, 2025 13:38
@pacmancoder pacmancoder enabled auto-merge (squash) December 2, 2025 13:39
@pacmancoder pacmancoder merged commit e455c4c into master Dec 2, 2025
9 checks passed
@pacmancoder pacmancoder deleted the feat/window-monitoring branch December 2, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants