sync: migrate sync devices from fs to mongodb

This commit is contained in:
Abdullah Atta
2025-12-22 20:11:43 +05:00
parent c7bb053cea
commit b98612be7a
19 changed files with 341 additions and 350 deletions

View File

@@ -40,6 +40,7 @@ namespace Notesnook.API.Controllers
Repository<InboxApiKey> inboxApiKeysRepository,
Repository<UserSettings> userSettingsRepository,
Repository<InboxSyncItem> inboxItemsRepository,
SyncDeviceService syncDeviceService,
ILogger<InboxController> logger) : ControllerBase
{
@@ -182,8 +183,7 @@ namespace Notesnook.API.Controllers
request.UserId = userId;
request.ItemId = ObjectId.GenerateNewId().ToString();
await inboxItemsRepository.InsertAsync(request);
new SyncDeviceService(new SyncDevice(userId, string.Empty))
.AddIdsToAllDevices([$"{request.ItemId}:inboxItems"]);
await syncDeviceService.AddIdsToAllDevicesAsync(userId, [new(request.ItemId, "inbox_item")]);
await WampServers.MessengerServer.PublishMessageAsync(MessengerServerTopics.SendSSETopic, new SendSSEMessage
{
OriginTokenId = null,