Skip to content

Conversation

ealsur
Copy link
Member

@ealsur ealsur commented Aug 15, 2019

Pull Request Template

Description

This PR applies a refactor on the UserAgentContainer, creating a child class Cosmos.UserAgentContainer that has a different base user agent. The new base user agent uses EnvironmentInformation and generates a format of:

{OS}/{Process Architecture} {SDK Version}/{Direct pkg Version}-{Framework} {ClientId} {UserSuffix}

For example:

Microsoft Windows 10.0.18362 /X64 3.1.1/3.1.4-.NET Core 4.6.27617.04 03445 mycustomsuffix

The information is read from the RuntimeEnvironment NET Standard 2.0 https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeenvironment?view=netstandard-2.0

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Closing issues

Closes #697

@ealsur ealsur added the bug Something isn't working label Aug 15, 2019
@ealsur ealsur self-assigned this Aug 15, 2019
@kirankumarkolli
Copy link
Member

Windows/10.0.17763 cosmos-netstandard-sdk/3.1.4 3.1.1-.NET Core 4.6.26614.01 X64 637014000798739244

Can it be abstracted to the scope we need. I.e. may-be

W/X64-WACosmos/3.1.... -.NET Core 4.6.26614.01

Thoughts?

@ealsur
Copy link
Member Author

ealsur commented Aug 15, 2019

The problem is that the initial part comes as part of the UserAgentContainer defined in Direct package, which is used down the stack.

The alternative would be to redefine the class?

@ealsur
Copy link
Member Author

ealsur commented Aug 15, 2019

@kirankumarkolli I ended up refactoring this PR. The new introduced logic was too complex, so I ended up simplifying this by creating our own UserAgentContainer that inherit from UserAgentContainer from Direct but defines our own base user agent string, with the information we wanted (Package versions, etc)

@kirankumarkolli
Copy link
Member

Can you please share new user-agent string?

@ealsur
Copy link
Member Author

ealsur commented Aug 16, 2019

@kirankumarkolli it's in the PR description, I updated the description when I refactored

j82w
j82w previously approved these changes Aug 21, 2019
@kirankumarkolli kirankumarkolli merged commit fba723f into master Aug 26, 2019
@kirankumarkolli kirankumarkolli deleted the users/ealsur/useragentlength branch August 26, 2019 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User-Agent string is too long and truncate customized user agent suffix
3 participants