Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Remove retry dialog at submission failed #718

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Covid19Radar/Covid19Radar.iOS/Covid19Radar.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
<Version>92.0.0</Version>
</PackageReference>
<PackageReference Include="Chino.iOS">
<Version>1.0.0-rc10</Version>
<Version>1.0.0-rc11</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
24 changes: 0 additions & 24 deletions Covid19Radar/Covid19Radar/Resources/AppResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions Covid19Radar/Covid19Radar/Resources/AppResources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,6 @@
<value>登録をキャンセルしました</value>
<comment>登録をキャンセルしました</comment>
</data>
<data name="NotifyOtherPageDiag3Message" xml:space="preserve">
<value>しばらくそのままでお待ちください。</value>
<comment>しばらくそのままでお待ちください。</comment>
</data>
<data name="NotifyOtherPageDiag3Title" xml:space="preserve">
<value>登録を開始します</value>
<comment>登録を開始します</comment>
</data>
<data name="NotifyOtherPageDiag4Message" xml:space="preserve">
<value>処理番号が入力されていません</value>
<comment>処理番号が入力されていません</comment>
Expand All @@ -619,14 +611,6 @@
<value>COVID-19接触のログ記録を有効にしてください</value>
<comment>COVID-19接触のログ記録を有効にしてください</comment>
</data>
<data name="NotifyOtherPageDiagReturnHomeTitle" xml:space="preserve">
<value>登録回数の上限に達しました</value>
<comment>登録回数の上限に達しました</comment>
</data>
<data name="NotifyOtherPageDiagReturnHome" xml:space="preserve">
<value>ホームに戻ります。</value>
<comment>ホームに戻ります。</comment>
</data>
<data name="ProcessingNumberErrorDiagTitle" xml:space="preserve">
<value>処理番号が違います</value>
<comment>処理番号が違います</comment>
Expand Down
16 changes: 0 additions & 16 deletions Covid19Radar/Covid19Radar/Resources/AppResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,6 @@
<value>Registration was canceled</value>
<comment>登録をキャンセルしました</comment>
</data>
<data name="NotifyOtherPageDiag3Message" xml:space="preserve">
<value>Please wait.</value>
<comment>しばらくそのままでお待ちください。</comment>
</data>
<data name="NotifyOtherPageDiag3Title" xml:space="preserve">
<value>Processing the registration</value>
<comment>登録を開始します</comment>
</data>
<data name="NotifyOtherPageDiag4Message" xml:space="preserve">
<value>No processing number entered</value>
<comment>処理番号が入力されていません</comment>
Expand All @@ -737,14 +729,6 @@
<value>Enable COVID-19 contact logging</value>
<comment>COVID-19接触のログ記録を有効にしてください</comment>
</data>
<data name="NotifyOtherPageDiagReturnHomeTitle" xml:space="preserve">
<value>Reached the maximum number of registrations</value>
<comment>登録回数の上限に達しました</comment>
</data>
<data name="NotifyOtherPageDiagReturnHome" xml:space="preserve">
<value>Return home</value>
<comment>ホームに戻ります。</comment>
</data>
<data name="ProcessingNumberErrorDiagTitle" xml:space="preserve">
<value>Incorrect processing number</value>
<comment>処理番号が違います</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ await _exposureNotificationApiService.ProvideDiagnosisKeysAsync(
_userDataRepository.SetLastConfirmedDate(_dateTimeUtility.UtcNow);
_userDataRepository.SetCanConfirmExposure(true);
}
catch(Exception)
catch (Exception exception)
{
_userDataRepository.SetCanConfirmExposure(false);
_loggerService.Exception($"Exception occurred: {region}", exception);
throw;
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,14 @@ private async Task UpdateView()

if (isStopped)
{
loggerService.Info("isStopped");
IsVisibleENStatusActiveLayout = false;
IsVisibleENStatusUnconfirmedLayout = false;
IsVisibleENStatusStoppedLayout = true;
}
else if (!canConfirmExposure)
{
loggerService.Info("canConfirmExposure is false");
IsVisibleENStatusActiveLayout = false;
IsVisibleENStatusUnconfirmedLayout = true;
IsVisibleENStatusStoppedLayout = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Covid19Radar.Common;
using Covid19Radar.Resources;
using System.Threading.Tasks;
using System.IO;
using System.Collections.Generic;
using Chino;
using System.Net;
Expand Down Expand Up @@ -119,8 +118,6 @@ public DateTime DiagnosisDate
set => SetProperty(ref _diagnosisDate, value);
}

private int errorCount { get; set; }

public NotifyOtherPageViewModel(
INavigationService navigationService,
ILoggerService loggerService,
Expand All @@ -137,7 +134,6 @@ public NotifyOtherPageViewModel(
this.diagnosisKeyRegisterServer = diagnosisKeyRegisterServer;
_delayForErrorMillis = delayForErrorMillis;
_essentialsService = essentialsService;
errorCount = 0;
ProcessingNumber = "";
DiagnosisDate = DateTime.Today;
}
Expand Down Expand Up @@ -212,37 +208,6 @@ await UserDialogs.Instance.AlertAsync(
// Check helthcare authority positive api check here!!
try
{
if (errorCount >= AppConstants.MaxErrorCount)
{
await UserDialogs.Instance.AlertAsync(
AppResources.NotifyOtherPageDiagReturnHome,
AppResources.NotifyOtherPageDiagReturnHomeTitle,
AppResources.ButtonOk
);
UserDialogs.Instance.HideLoading();
await NavigationService.NavigateAsync(Destination.HomePage.ToPath());

loggerService.Error($"Exceeded the number of trials.");
loggerService.EndMethod();
return;
}

loggerService.Info($"Number of attempts to submit diagnostic number. ({errorCount + 1} of {AppConstants.MaxErrorCount})");

if (errorCount > 0)
{
await UserDialogs.Instance.AlertAsync(AppResources.NotifyOtherPageDiag3Message,
AppResources.NotifyOtherPageDiag3Title,
AppResources.ButtonOk
);
await Task.Delay(errorCount * _delayForErrorMillis);
}

loggerService.Info($"Number of attempts to submit diagnostic number. ({errorCount + 1} of {AppConstants.MaxErrorCount})");

if (errorCount > 0)


// Init Dialog
if (string.IsNullOrEmpty(ProcessingNumber))
{
Expand All @@ -251,7 +216,6 @@ await UserDialogs.Instance.AlertAsync(
AppResources.ProcessingNumberErrorDiagTitle,
AppResources.ButtonOk
);
errorCount++;
loggerService.Error($"No diagnostic number entered.");
return;
}
Expand All @@ -263,7 +227,6 @@ await UserDialogs.Instance.AlertAsync(
AppResources.ProcessingNumberErrorDiagTitle,
AppResources.ButtonOk
);
errorCount++;
loggerService.Error($"Incorrect process number format.");
return;
}
Expand Down Expand Up @@ -291,7 +254,6 @@ await UserDialogs.Instance.AlertAsync(
{
UserDialogs.Instance.HideLoading();

errorCount++;
UserDialogs.Instance.Alert(
AppResources.NotifyOtherPageDialogExceptionText,
AppResources.NotifyOtherPageDialogExceptionTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Prism.Navigation;
using Acr.UserDialogs;
using Xunit;
using Covid19Radar.Resources;

namespace Covid19Radar.UnitTests.ViewModels.HomePage
{
Expand Down Expand Up @@ -72,54 +71,6 @@ public void CheckRegisterButtonEnableTest(string processingNumber, bool isVisibl

Assert.Equal(expectResult, result);
}

[Fact]
public void CheckRegisterButtonMaxErrorCountReturnHomeTest()
{
mockUserDialogs
.Setup(x => x.ConfirmAsync(
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<string>(),
null)
)
.Returns(Task.FromResult(true));

mockUserDialogs
.Setup(x => x.AlertAsync(
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<string>(),
null)
)
.Returns(Task.FromResult(true));

var vm = CreateViewModel();
vm.ProcessingNumber = "1";

vm.OnClickRegister.Execute(null);
vm.OnClickRegister.Execute(null);
vm.OnClickRegister.Execute(null);

mockUserDialogs.Verify(x => x.AlertAsync(
AppResources.NotifyOtherPageDiag5Message,
AppResources.ProcessingNumberErrorDiagTitle,
AppResources.ButtonOk,
null
), Times.Exactly(3));

vm.OnClickRegister.Execute(null);

mockUserDialogs.Verify(x => x.AlertAsync(
AppResources.NotifyOtherPageDiagReturnHome,
AppResources.NotifyOtherPageDiagReturnHomeTitle,
AppResources.ButtonOk,
null
), Times.Once());

mockNavigationService.Verify(x => x.NavigateAsync("/MenuPage/NavigationPage/HomePage"), Times.Once());
}
}

#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
Expand Down