imap: synchronize a fully fetched message w/ local db
The messages list is first retrieved from Proton via the /messages call. A JSON representation of each of these messages is saved in a local db. However, the retrieved JSON description doesn't include the MIMEType field which is left empty.
This CL fixes this by always sync'ing the local db with the full message description as soon as it's retrieved from Proton.
Fixes emersion/hydroxide#112.
Hm. I'm worried this might significantly slow down IMAP responses, but I don't know if there's a better way to fix it.
Ah, this doesn't actually fetch the messages more often, this just stores more info in the DB.
Hm. Does this rely on the order in which the client performs requests? e.g. if the client doesn't trigger fetchBodySection and only fetches the BODYSTRUCTURE, this wouldn't work?
e.g. if the client doesn't trigger fetchBodySection and only fetches the BODYSTRUCTURE, this wouldn't work?
not sure I have the required know-how to be able to answer that question. sorry.