Merged PR 7106: Todo Cleanup
Cleaning up TODOs and warnings Related work items: #53807
This commit is contained in:
Родитель
3f3ddc35ca
Коммит
61c7759cd7
|
@ -32,7 +32,7 @@ namespace Microsoft.HealthVault.Client
|
|||
return this.cachedConnection;
|
||||
}
|
||||
|
||||
var missingProperties = new List<string>();
|
||||
var missingProperties = new List<string>();
|
||||
|
||||
Guid masterApplicationId = configuration.MasterApplicationId;
|
||||
if (masterApplicationId == Guid.Empty)
|
||||
|
@ -63,7 +63,6 @@ namespace Microsoft.HealthVault.Client
|
|||
nameof(GetOrCreateSodaConnection),
|
||||
currentConfiguration.MasterApplicationId,
|
||||
configuration.MasterApplicationId));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using Microsoft.HealthVault.Clients;
|
||||
using Microsoft.HealthVault.Configuration;
|
||||
using Microsoft.HealthVault.Connection;
|
||||
using Microsoft.HealthVault.Exceptions;
|
||||
using Microsoft.HealthVault.Helpers;
|
||||
|
@ -13,8 +14,6 @@ using Microsoft.HealthVault.PlatformInformation;
|
|||
using Microsoft.HealthVault.Record;
|
||||
using Microsoft.HealthVault.Rest;
|
||||
using Microsoft.HealthVault.Transport;
|
||||
using System.Linq;
|
||||
using Microsoft.HealthVault.Configuration;
|
||||
using Microsoft.HealthVault.Transport.MessageFormatters.SessionFormatters;
|
||||
|
||||
namespace Microsoft.HealthVault.Client
|
||||
|
@ -196,7 +195,9 @@ namespace Microsoft.HealthVault.Client
|
|||
UrlUtilities.GetFullPlatformUrl(defaultHealthVaultUrl),
|
||||
defaultHealthVaultShellUrl);
|
||||
|
||||
// TODO: Eliminate circular call. This method is called from AuthenticateAsync. PlatformClient is calling HealthVaultConnectionBase.ExecuteAsync, which is calling AuthenticateAsync
|
||||
// Note: This apparent circular call is intentional. This method is called from AuthenticateAsync.
|
||||
// PlatformClient is calling HealthVaultConnectionBase.ExecuteAsync("NewApplicationCreationInfo"),
|
||||
// which avoids calling AuthenticateAsync because "NewApplicationCreationInfo" is an anonymous method.
|
||||
IPlatformClient platformClient = this.CreatePlatformClient();
|
||||
ApplicationCreationInfo newApplicationCreationInfo = await platformClient.NewApplicationCreationInfoAsync().ConfigureAwait(false);
|
||||
|
||||
|
@ -237,7 +238,8 @@ namespace Microsoft.HealthVault.Client
|
|||
{
|
||||
var personClient = this.CreatePersonClient();
|
||||
|
||||
// TODO: Eliminate circular call. This method is called from AuthenticateAsync. PersonClient is calling HealthVaultConnectionBase.ExecuteAsync, which is calling AuthenticateAsync
|
||||
// Note: This apparent circular call is intentional. This method is called from AuthenticateAsync. PersonClient is calling HealthVaultConnectionBase.ExecuteAsync,
|
||||
// which would call AuthenticateAsync again if not for the fact that Authenticate filled in its SessionCredential.Token before calling this method the first time through.
|
||||
PersonInfo newPersonInfo = (await personClient.GetAuthorizedPeopleAsync().ConfigureAwait(false)).FirstOrDefault();
|
||||
|
||||
await this.localObjectStore.WriteAsync(PersonInfoKey, newPersonInfo).ConfigureAwait(false);
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
// Copyright(c) Microsoft Corporation.
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Text;
|
||||
using Microsoft.HealthVault.Transport;
|
||||
using Microsoft.HealthVault.Transport.MessageFormatters.AuthenticationFormatters;
|
||||
using Microsoft.HealthVault.Transport.MessageFormatters.HeaderFormatters;
|
||||
using Microsoft.HealthVault.Transport.MessageFormatters.SessionFormatters;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace Microsoft.HealthVault.UnitTest.CloudRequestTests
|
||||
|
@ -60,7 +58,7 @@ namespace Microsoft.HealthVault.UnitTest.CloudRequestTests
|
|||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task WhenCreatingASessionToken_ThenExistingAuthSessionIsNotPopulated()
|
||||
public void WhenCreatingASessionToken_ThenExistingAuthSessionIsNotPopulated()
|
||||
{
|
||||
HealthVaultMethods method = HealthVaultMethods.CreateAuthenticatedSessionToken;
|
||||
HealthServiceMessage req = new HealthServiceMessage(
|
||||
|
|
|
@ -37,8 +37,8 @@ namespace Microsoft.HealthVault.Web.Configuration
|
|||
HealthVaultUrl = appSettings.GetUrl(ConfigKeys.HealthServiceUrl, true),
|
||||
|
||||
RequestTimeoutDuration = appSettings.GetTimeSpanFromSeconds(
|
||||
ConfigKeys.DefaultRequestTimeoutSeconds,
|
||||
HealthVaultConfigurationDefaults.RequestTimeoutDuration) ??
|
||||
ConfigKeys.DefaultRequestTimeoutSeconds,
|
||||
HealthVaultConfigurationDefaults.RequestTimeoutDuration) ??
|
||||
HealthVaultConfigurationDefaults.RequestTimeoutDuration,
|
||||
|
||||
RequestTimeToLiveDuration = appSettings.GetTimeSpanFromSeconds(
|
||||
|
@ -80,8 +80,8 @@ namespace Microsoft.HealthVault.Web.Configuration
|
|||
|
||||
private static Uri TryReadingActionUrlRedirectOverride(NameValueCollection appSettings)
|
||||
{
|
||||
return String.IsNullOrEmpty(appSettings[ConfigKeys.NonProductionActionUrlRedirectOverride])
|
||||
? null
|
||||
return string.IsNullOrEmpty(appSettings[ConfigKeys.NonProductionActionUrlRedirectOverride])
|
||||
? null
|
||||
: new Uri(appSettings[ConfigKeys.NonProductionActionUrlRedirectOverride], UriKind.RelativeOrAbsolute);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,10 @@
|
|||
using Microsoft.HealthVault.Connection;
|
||||
using Microsoft.HealthVault.Extensions;
|
||||
using Microsoft.HealthVault.Services;
|
||||
using Microsoft.HealthVault.Transport;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.HealthVault
|
||||
{
|
||||
|
||||
internal static class Ioc
|
||||
{
|
||||
static Ioc()
|
||||
|
|
|
@ -9,7 +9,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.Globalization;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using Microsoft.HealthVault.Clients;
|
||||
using Microsoft.HealthVault.Exceptions;
|
||||
using Microsoft.HealthVault.Helpers;
|
||||
using Microsoft.HealthVault.Thing;
|
||||
|
|
|
@ -269,10 +269,6 @@ namespace Microsoft.HealthVault.Rest
|
|||
|
||||
private async Task<HealthServiceRestResponseData> FetchAsync()
|
||||
{
|
||||
return await this.FetchInternalAsync(this.uri).ConfigureAwait(false);
|
||||
|
||||
// TODO: IConnection-ify this.
|
||||
/*
|
||||
try
|
||||
{
|
||||
return await this.FetchInternalAsync(this.uri).ConfigureAwait(false);
|
||||
|
@ -283,9 +279,9 @@ namespace Microsoft.HealthVault.Rest
|
|||
// new token from the user and retry the call again
|
||||
var response = we.InnerException as HealthHttpException;
|
||||
if (response != null &&
|
||||
response.StatusCode == HttpStatusCode.Unauthorized &&
|
||||
this.connection.Credential.ExpireAuthenticationResult(this.connection.ApplicationConfiguration.ApplicationId))
|
||||
response.StatusCode == HttpStatusCode.Unauthorized)
|
||||
{
|
||||
await this.connection.AuthenticateAsync().ConfigureAwait(false);
|
||||
return await this.FetchInternalAsync(this.uri).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
|
@ -293,7 +289,6 @@ namespace Microsoft.HealthVault.Rest
|
|||
throw;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private async Task<HealthServiceRestResponseData> FetchInternalAsync(Uri uri)
|
||||
|
|
|
@ -26,8 +26,6 @@ namespace Microsoft.HealthVault.Transport
|
|||
/// This class is not thread safe. A new instance should be created when multiple requests
|
||||
/// must execute concurrently.
|
||||
/// </remarks>
|
||||
///
|
||||
/// TODO: DO NOT USE OUTSIDE OF ConnectionInternalBase
|
||||
internal class HealthServiceMessage
|
||||
{
|
||||
private readonly AuthenticationFormatter authenticationFormatter;
|
||||
|
@ -102,7 +100,7 @@ namespace Microsoft.HealthVault.Transport
|
|||
this.RecordId,
|
||||
this.TargetPersonId,
|
||||
transform,
|
||||
this.requestTtl,
|
||||
this.requestTtl,
|
||||
this.authSessionOrAppId,
|
||||
info);
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// MIT License
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
//
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
|
@ -31,8 +31,8 @@ namespace Microsoft.HealthVault.Transport.MessageFormatters.HeaderFormatters
|
|||
private byte[] cachedContent;
|
||||
|
||||
public HeaderFormatter(
|
||||
HealthVaultMethods method,
|
||||
string methodVersion,
|
||||
HealthVaultMethods method,
|
||||
string methodVersion,
|
||||
string cultureCode,
|
||||
string version,
|
||||
Guid recordId,
|
||||
|
@ -108,7 +108,7 @@ namespace Microsoft.HealthVault.Transport.MessageFormatters.HeaderFormatters
|
|||
}
|
||||
|
||||
writer.WriteElementString("msg-time", SDKHelper.XmlFromNow());
|
||||
writer.WriteElementString("msg-ttl", ((int) this.ttl.GetValueOrDefault().TotalSeconds).ToString(CultureInfo.InvariantCulture));
|
||||
writer.WriteElementString("msg-ttl", ((int)this.ttl.GetValueOrDefault().TotalSeconds).ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
writer.WriteElementString("version", this.version);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace SandboxUwp
|
|||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
{
|
||||
// TODO: Load state from previously suspended application
|
||||
// Load state from previously suspended application
|
||||
}
|
||||
|
||||
// Place the frame in the current Window
|
||||
|
@ -85,7 +85,7 @@ namespace SandboxUwp
|
|||
{
|
||||
var deferral = e.SuspendingOperation.GetDeferral();
|
||||
|
||||
// TODO: Save application state and stop any background activity
|
||||
// Save application state and stop any background activity
|
||||
deferral.Complete();
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче