Skip to content

Store folders realtime sync status #107

@netandreus

Description

@netandreus

Describe the bug
Now there is no way to know is folder syncing just now.

Possible solution
We need to save folder syncing state in database.
I suggest to add info to the folder table sync info, because in the future, several sync may be used.

  • sync_status - actual real-time sync status
  • sync_host - last host, that synced folder / current syncing host
  • sync_pid- last process id, that synced folder / current syncing process id
  • synced_at - last sync timestamp

Sync status

  1. NOT_SYNCED
  2. SYNCING
  3. SYNCING_NEED_RESYNC
  4. SYNCED_NEED_RESYNC
  5. SYNCED
  6. ERROR

NOT_SYNCED
Initial state, when folder just added to database and syncing process has never processed.

SYNCING
This folder is syncing now.

SYNCING_NEED_RESYNC
This folder is syncing now, and we received one or more request for resync after syncing process started. Example: syncing process started and user delete / change flag of message, which already synced. We can not miss this event and resyncing needed.

SYNCED_NEED_RESYNC
This folder is just synced, another folder of the same account is syncing now.
That means, that sync is running now for this account.
After account sync is complete we need to resync this folder, because watcher tell us, that folder is changed.

SYNCED
Sync process completed and there is no new events received from imap server ("mail" / "update" / "purge").

ERROR
There was some error, during sync process.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions