Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for user agents #1819

Merged
merged 2 commits into from
Jan 9, 2019
Merged

Add support for user agents #1819

merged 2 commits into from
Jan 9, 2019

Conversation

nirinchev
Copy link
Member

@nirinchev nirinchev commented Dec 28, 2018

Description

Based on #1772 - rebase after merging it.

Fixes #1809

Here's example logs in ROS:

from iOS simulator

Client info: (path='/189610dfb70300c3046f7328f3cf0cf7/merge_by_pk_PrimaryKeyInt64Object', user='189610dfb70300c3046f7328f3cf0cf7', from=[127.0.0.1]:56396, protocol=25) RealmSync/3.14.9 (iOS Darwin 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64) RealmNet/3.3.0.0 (Mono 5.14.0 (explicit/000780ca82c)) MergeByPKTests

from .NET Core running on macOS

Client info: (path='/189610dfb70300c3046f7328f3cf0cf7/merge_by_pk_PrimaryKeyStringObject', user='189610dfb70300c3046f7328f3cf0cf7', from=[127.0.0.1]:55811, protocol=25) RealmSync/3.14.9 (macOS Darwin 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64) RealmNet/3.3.0.0 (.NET Core 4.6.26625.01) MergeByPKTests

MergeByPKTests is the custom user agent specified by the user.

.NET doesn't have an automatic way of detecting the app name because some of the platforms we support don't have a concept of an app name - e.g. .NET Core and Windows apps, so it's up to the user to set the UserAgent to the app name/version.

TODO

  • Changelog entry
  • Update PCL (if applicable)

@realm-probot
Copy link

realm-probot bot commented Dec 28, 2018

Hey - looks like you forgot to add a T:* label - could you please add one?

Copy link
Contributor

@kspangsege kspangsege left a comment

Choose a reason for hiding this comment

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

Looks good to me

internal SyncConfigurationBase(Uri serverUri, User user = null, string optionalPath = null)
{
RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
}

/// <summary>
/// Gets or sets a value indicating how detailed the sync client's logs will be.
/// Configures various parameters of the sync .
Copy link
Member

Choose a reason for hiding this comment

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

Summary doesn't look right.

@@ -108,12 +142,29 @@ internal SyncConfigurationBase(Uri serverUri, User user = null, string optionalP
}

/// <summary>
/// Gets or sets a value indicating how detailed the sync client's logs will be.
/// Configures various parameters of the sync .
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

internal static string GetSDKUserAgent()
{
var version = typeof(SyncConfigurationBase).GetTypeInfo().Assembly.GetName().Version;
return $"RealmNet/{version} ({RuntimeInformation.FrameworkDescription})";
Copy link
Member

Choose a reason for hiding this comment

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

How about RealmDotNet?

@nirinchev nirinchev force-pushed the ni/user-agent branch 2 times, most recently from 7ed09da to 0eb21b4 Compare January 9, 2019 12:31
@nirinchev nirinchev changed the base branch from ni/new-sync to master January 9, 2019 12:33
@nirinchev nirinchev merged commit 3b99319 into master Jan 9, 2019
@nirinchev nirinchev deleted the ni/user-agent branch January 9, 2019 13:31
nirinchev added a commit that referenced this pull request Jul 10, 2019
* master: (89 commits)
  Prepare for 4.0.1 (#1876)
  Fix iOS device builds (#1875)
  Prepare for 4.0.0 (#1868)
  Refactor packaging (#1849)
  Update CHANGELOG.md (#1828)
  Add session.stop/start methods (#1839)
  Prepare for 3.4.0 (#1826)
  Ensure GetInstanceAsync works with QBS config (#1827)
  Add ability to define custom log function (#1824)
  Add support for user agents (#1819)
  Bump Sync to 3.10.1 (#1772)
  Update ISSUE_TEMPLATE.md
  Release 3.3.0 (#1808)
  Expose SyncConfiguration.OnProgress (#1807)
  Throw an error when trying to call async subscription methods on background threads (#1783)
  Update CHANGELOG.md (#1777)
  Prepare for 3.2.1 (#1775)
  Fix subscription state size (#1774)
  Release 3.2.0 (#1769)
  Add ShouldCompactOnLaunch to the PCL RealmConfig (#1768)
  ...

# Conflicts:
#	Platform.PCL/Realm.PCL/Extensions/CollectionNotificationsExtensionsPCL.cs
#	Tests/Tests.Shared/CollectionTests.cs
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants