MailSet support (static mail listIds)

In order to allow importing of mails we replace legacy MailFolders
(non-static mail listIds) with new MailSets (static mail listIds).
From now on, mails have static mail listIds and static mail elementIds.
To move mails between new MailSets we introduce MailSetEntries
("entries" property on a MailSet), which are index entries sorted by
the received date of the referenced mails (customId). This commit adds
support for new MailSets, while still supporting legacy MailFolders
(mail lists) to support migrating gradually.

* TutanotaModelV74 adds:
  * MailSet support
  * and defaultAlarmList on GroupSettings

* SystemModelV107 adds model changes for counter (unread mails) updates

* Adapt mail list to show MailSet and legacy mails
  The list model is now largely unaware about listIds since it can
  display mails from multiple MailBags. MailBags are static mailLists
  from which a mail is only removed from when the mail is permanently
  deleted.

* Adapt offline storage for mail sets
  Offline storage gained the ability to provide cached entities
  from a list of ids.
This commit is contained in:
map 2024-08-07 08:38:58 +02:00 committed by Johannes Münichsdorfer
parent b803773b4d
commit 2d24bab6f9
97 changed files with 33829 additions and 1275 deletions

View file

@ -198,7 +198,7 @@ export class UserListView implements UpdatableSettingsViewer {
const { instanceListId, instanceId, operation } = update
if (isUpdateForTypeRef(GroupInfoTypeRef, update) && this.listId.getSync() === instanceListId) {
await this.listModel.entityEventReceived(instanceId, operation)
await this.listModel.entityEventReceived(instanceListId, instanceId, operation)
} else if (isUpdateFor(locator.logins.getUserController().user, update)) {
await this.loadAdmins()
this.listModel.reapplyFilter()
@ -228,7 +228,7 @@ export class UserListView implements UpdatableSettingsViewer {
return { items: allUserGroupInfos, complete: true }
},
loadSingle: async (elementId) => {
loadSingle: async (_listId: Id, elementId: Id) => {
const listId = await this.listId.getAsync()
try {
return await locator.entityClient.load<GroupInfo>(GroupInfoTypeRef, [listId, elementId])