1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-09-27 03:52:57 +02:00
bitwarden-mobile/src/Core/Abstractions/ISyncService.cs
Bernd Schoolmann eea7c6b7d7
[PM-2901] Synchronize sends on send creation/update/deletion notification (#2606)
* Add sync on send create/update/delete notification

* Update send notifications to only sync sends

* Fix incorrect notification type in PushNotificationListenerService

Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>

* Invert if to improve readability

* Simplify shouldUpdate logic in SyncUpsertSendAsync

* Further simplify SyncService code

* Fix if condition in SyncService

Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>

* Fixed whitespace formatting

---------

Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>
Co-authored-by: Andre Rosado <arosado@bitwarden.com>
2023-08-08 14:59:42 +01:00

23 lines
1020 B
C#

using System;
using System.Threading.Tasks;
using Bit.Core.Models.Response;
namespace Bit.Core.Abstractions
{
public interface ISyncService
{
bool SyncInProgress { get; set; }
Task<bool> FullSyncAsync(bool forceSync, bool allowThrowOnError = false);
Task<DateTime?> GetLastSyncAsync();
Task SetLastSyncAsync(DateTime date);
Task<bool> SyncDeleteCipherAsync(SyncCipherNotification notification);
Task<bool> SyncDeleteFolderAsync(SyncFolderNotification notification);
Task<bool> SyncDeleteSendAsync(SyncSendNotification notification);
Task<bool> SyncUpsertCipherAsync(SyncCipherNotification notification, bool isEdit);
Task<bool> SyncUpsertFolderAsync(SyncFolderNotification notification, bool isEdit);
Task<bool> SyncUpsertSendAsync(SyncSendNotification notification, bool isEdit);
// Passwordless code will be moved to an independent service in future techdept
Task SyncPasswordlessLoginRequestsAsync();
}
}