[SG-831] Pull Down Sync does not retrieve pending AuthRequests (#2196)

* [SG-831] Pull to refresh forces refresh.

* [SG-831] Expose sync login request method to be used independently

* [SG-831] Change sync order
This commit is contained in:
André Bispo 2022-11-17 16:02:34 +00:00 committed by GitHub
parent 8e09f0cc15
commit 34fd30e157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 2 deletions

View File

@ -90,6 +90,7 @@ namespace Bit.App.Pages
try try
{ {
await _deviceActionService.ShowLoadingAsync(AppResources.Syncing); await _deviceActionService.ShowLoadingAsync(AppResources.Syncing);
await _syncService.SyncPasswordlessLoginRequestsAsync();
var success = await _syncService.FullSyncAsync(true); var success = await _syncService.FullSyncAsync(true);
await _deviceActionService.HideLoadingAsync(); await _deviceActionService.HideLoadingAsync();
if (success) if (success)

View File

@ -189,6 +189,7 @@ namespace Bit.App.Pages
if (await _stateService.GetSyncOnRefreshAsync() && Refreshing && !SyncRefreshing) if (await _stateService.GetSyncOnRefreshAsync() && Refreshing && !SyncRefreshing)
{ {
SyncRefreshing = true; SyncRefreshing = true;
await _syncService.SyncPasswordlessLoginRequestsAsync();
await _syncService.FullSyncAsync(false); await _syncService.FullSyncAsync(false);
return; return;
} }

View File

@ -14,5 +14,7 @@ namespace Bit.Core.Abstractions
Task<bool> SyncDeleteFolderAsync(SyncFolderNotification notification); Task<bool> SyncDeleteFolderAsync(SyncFolderNotification notification);
Task<bool> SyncUpsertCipherAsync(SyncCipherNotification notification, bool isEdit); Task<bool> SyncUpsertCipherAsync(SyncCipherNotification notification, bool isEdit);
Task<bool> SyncUpsertFolderAsync(SyncFolderNotification notification, bool isEdit); Task<bool> SyncUpsertFolderAsync(SyncFolderNotification notification, bool isEdit);
// Passwordless code will be moved to an independent service in future techdept
Task SyncPasswordlessLoginRequestsAsync();
} }
} }

View File

@ -111,7 +111,6 @@ namespace Bit.Core.Services
await SyncSettingsAsync(userId, response.Domains); await SyncSettingsAsync(userId, response.Domains);
await SyncPoliciesAsync(response.Policies); await SyncPoliciesAsync(response.Policies);
await SyncSendsAsync(userId, response.Sends); await SyncSendsAsync(userId, response.Sends);
await SyncPasswordlessLoginRequestsAsync(userId);
await SetLastSyncAsync(now); await SetLastSyncAsync(now);
return SyncCompleted(true); return SyncCompleted(true);
} }
@ -387,10 +386,11 @@ namespace Bit.Core.Services
await _sendService.ReplaceAsync(sends); await _sendService.ReplaceAsync(sends);
} }
private async Task SyncPasswordlessLoginRequestsAsync(string userId) public async Task SyncPasswordlessLoginRequestsAsync()
{ {
try try
{ {
var userId = await _stateService.GetActiveUserIdAsync();
// if the user has not enabled passwordless logins ignore requests // if the user has not enabled passwordless logins ignore requests
if (!await _stateService.GetApprovePasswordlessLoginsAsync(userId)) if (!await _stateService.GetApprovePasswordlessLoginsAsync(userId))
{ {