mirror of
https://github.com/bitwarden/android.git
synced 2024-12-26 19:08:32 +03:00
[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:
parent
8e09f0cc15
commit
34fd30e157
4 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue