After we detect that the user has suffered the GODT-3003 bug due the
vault corruption not ensuring that a previous sync state would be
erased, we patch the gluon db directly and then reset the sync state.
After the account is added, the sync is automatically triggered and the
account state fixes itself.
Incoming messages which arrive into labels we know during sync are now
presented to the IMAP clients.
We also allow messages to be deleted while syncing if deleted on other
clients.
Other operations such as moving, marking messages as read and label
operations need to be considered in a follow up patch as they are far
more complex.
The IMAP service no longer blocks the event loop from progressing. When
syncing the event loop continues as usual, allow other parts of the
bridge to continue updating.
Once the sync is complete, it resets the event id back to the last
handled id before sync started and then we play catch up.
Checking for the initial status of the original check as this is not
required to verify the intended behavior. The original check is also
prone to issues related to event processing order.
Update ServerManager to follow the new expected behavior. The servers
will only be started when one user is active.
If all users are logged out or removed from the system, the servers will
stop.
If the network goes down, the servers will stop and resume once network
has been restored.
Requires gluon update where the fix was applied.
Disable TestBridge_Sync_BadMessage as it is no longer valid with the
latest Gluon fixes. Traked as GODT-2215.
During sync a user may continue to perform operations on the server it
is possible we run into a message which has a labelID we are not aware
of. To counter this we issue `CreateMessage` updates with
`IgnoreUnknownMailboxIDs` set to true. Eventually, after sync the state
will resolve itself with events.
Gluon used to have a bug where it would unnecessarily call the
reporter's ReportMessageWithContext method whenever an IMAP client would
drop unexpectedly. After fixing the bug, we can remove these gomock
EXPECT.AnyTimes() calls.
We should only listen on constants.Host when serving IMAP and SMTP.
This change fixes that. It also adds a test that we can send over SMTP
and receive over IMAP.
Depending on the timing of bridge closure, it was possible for the
IMAP/SMTP servers to not have started serving yet. By grouping this in
a cancelable goroutine group (*xsync.Group), we mitigate this issue.
Further, depending on internet disconnection timing during user login,
it was possible for a user to be improperly logged in. This change
fixes this and adds test coverage for it.
Lastly, depending on timing, certain background tasks (updates check,
connectivity ping) could be improperly started or closed. This change
groups them in the *xsync.Group as well to be closed properly.
Add missing Close calls.
Properly handle nil channel for `user.startSync`.
This patch also updated liteapi and Gluon to latest master and dev
version respectively.