Sync error with a Fastmail account

Hi,

For several versions now I’m experiencing the same bug. Currently I am using Mailspring 1.7.8 and MacOS 10.14.6.

When I add a Fastmail account, the first several syncs go well after which there’s a recurrent sync error. I can fix it only if I delete the Fastmail account and then connect it again.

If Mailspring is relaunched, the first sync (or maybe several) go fine; but after a minute a two the abovementioned error starts to show up

Here is the error log:

Platform

Mailspring Version: 1.7.8-13635bcf
Platform: darwin
Account State: sync_error
Account Provider: fastmail
IMAP Server: imap.fastmail.com
SMTP Server: smtp.fastmail.com

6198 [2020-09-18 16:34:53.677] [background] [info] syncFolderChangesViaCondstore - Drafts: modseq 725123 to 725123, uidnext 2705 to 2705
6198 [2020-09-18 16:34:53.810] [background] [info] syncFolderUIDRange for Archive, UIDs: 15986 - 20986, Heavy: true
6198 [2020-09-18 16:34:54.684] [foreground] [info] syncFolderChangesViaCondstore - INBOX: modseq 728123 to 728123, uidnext 7334 to 7334
6198 [2020-09-18 16:34:54.684] [foreground] [info] Idling on folder INBOX
6198 [2020-09-18 16:34:55.122] [background] [info] - remote=5001, local=4003
6198 [2020-09-18 16:34:55.279] [background] [critical]

*** Mailspring Sync
*** A JSON exception occurred during program execution:
*** [json.exception.type_error.316] invalid UTF-8 byte at index 1: 0xBF

6198 [2020-09-18 16:34:55.897] [background] [critical] *** Stack trace (line numbers are approximate):
*** in mailsync exceptions::logCurrentExceptionWithStackTrace()
*** in mailsync runBackgroundSyncWorker()
*** in mailsync main::$_6::operator()() const
*** in mailsync void* __thread_proxy(void*)
*** in mailsync thread_start()

6201 [2020-09-18 16:34:59.268] [main] [info] Identity created at 1536593504 - using ID Schema 1
6201 [2020-09-18 16:34:59.269] [main] [info] ------------- Starting Sync ([dima@fastmail.co.uk](mailto:dima@fastmail.co.uk)) ---------------
6201 [2020-09-18 16:34:59.279] [metadata] [info] Metadata delta stream starting...
6201 [2020-09-18 16:35:03.282] [background] [info] Marking all folders as `busy`
6201 [2020-09-18 16:35:03.287] [background] [info] Syncing folder list...
6201 [2020-09-18 16:35:05.171] [background] [info] Syncing folder list...
6201 [2020-09-18 16:35:05.438] [background] [info] syncFolderChangesViaCondstore - INBOX: modseq 728123 to 728123, uidnext 7334 to 7334
6201 [2020-09-18 16:35:05.574] [background] [info] syncFolderChangesViaCondstore - Sent: modseq 726492 to 726492, uidnext 23368 to 23368
6201 [2020-09-18 16:35:05.719] [background] [info] syncFolderChangesViaCondstore - Drafts: modseq 725123 to 725123, uidnext 2705 to 2705
6201 [2020-09-18 16:35:05.848] [background] [info] syncFolderUIDRange for Archive, UIDs: 15986 - 20986, Heavy: true
6201 [2020-09-18 16:35:06.472] [foreground] [info] syncFolderChangesViaCondstore - INBOX: modseq 728123 to 728123, uidnext 7334 to 7334
6201 [2020-09-18 16:35:06.472] [foreground] [info] Idling on folder INBOX
6201 [2020-09-18 16:35:07.050] [background] [info] - remote=5001, local=4003
6201 [2020-09-18 16:35:07.202] [background] [critical]

*** Mailspring Sync
*** A JSON exception occurred during program execution:
*** [json.exception.type_error.316] invalid UTF-8 byte at index 1: 0xBF

6201 [2020-09-18 16:35:07.436] [background] [critical] *** Stack trace (line numbers are approximate):
*** in mailsync exceptions::logCurrentExceptionWithStackTrace()
*** in mailsync runBackgroundSyncWorker()
*** in mailsync main::$_6::operator()() const
*** in mailsync void* __thread_proxy(void*)
*** in mailsync thread_start()

(Originally posted by ay4 on GitHub.)