Skip to content

Conversation

samsharma2700
Copy link
Contributor

@samsharma2700 samsharma2700 commented Sep 10, 2025

Description

Part 3 for User Agent Feature Extension work. Following are added in this PR:-

  • Enabling the pre-calculated JsonPayload to be added to the FE data.
  • Adding case handling logic in case of a server ack.
  • Changes to test server to force emit Ack for this feature(testing purposes).
  • Two new tests to verify both Acked and Unacked pathways work.

Part 2 : #3451
Part 1 : #3582

Unit tests and functional tests are passing

@Copilot Copilot AI review requested due to automatic review settings September 10, 2025 00:14
@samsharma2700 samsharma2700 requested a review from a team as a code owner September 10, 2025 00:14
Copy link
Contributor

@Copilot 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 implements Part 3 of the User Agent Feature Extension work, adding the ability to send User Agent information in TDS login packets and handle server acknowledgments. The implementation includes TDS protocol support for the new feature extension and test coverage to verify the functionality.

  • Adds UserAgentSupport feature ID to TDS protocol and enables sending User Agent JSON payload during login
  • Updates both .NET Framework and .NET Core implementations to include User Agent data in feature extension requests
  • Implements server acknowledgment handling with appropriate logging when unexpected ACKs are received

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDSFeatureID.cs Adds UserAgentSupport feature ID enum value
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/GenericTDSServerSession.cs Adds IsUserAgentSupportEnabled property to server session
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/GenericTDSServer.cs Implements User Agent feature extension handling in test server
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/ITDSServerSession.cs Adds User Agent support interface definition
src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlConnectionBasicTests.cs Adds tests for User Agent feature extension behavior with and without server ACK
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs Updates TdsLogin to include User Agent payload in feature extension data
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs Implements User Agent feature request writing for .NET Framework
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs Adds User Agent ACK handling and property name correction
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs Implements User Agent feature request writing for .NET Core
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs Adds User Agent ACK handling and property name correction
@paulmedynski paulmedynski changed the title Dev/samsharma2700/user agent fe Sep 10, 2025
Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

A few unused/unnecessary fields to remove, and need to add some checks to the tests.

@paulmedynski paulmedynski added this to the 7.0-preview1 milestone Sep 10, 2025
Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Still some cleanup to be done - mostly in the tests.

Also, we need to change the USERAGENT feature extension value from 0x0F to 0x10. Please update that value.

@paulmedynski paulmedynski self-assigned this Sep 11, 2025
paulmedynski
paulmedynski previously approved these changes Sep 12, 2025
Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Yay - all good!

benrr101
benrr101 previously approved these changes Oct 9, 2025
Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

Overall, looks pretty ok. Couple things to look out for, but as long as @paulmedynski 's concerns are addressed, I'm ok to move forward.

benrr101
benrr101 previously approved these changes Oct 10, 2025
paulmedynski
paulmedynski previously approved these changes Oct 11, 2025
cheenamalhotra
cheenamalhotra previously approved these changes Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants