Created a new updateThreads function which will replace the updateEmails function β it fetches the threads from Gmail/Outlook and converts them into the correct data structure for storage straight into IndexedDB
Finally redid the schema for email storage and transitioned from email objects to thread objects containing message objects! Now there will be a ton less weird edge case behaviours when it comes to threads
Spent six hours straight trying to take full advantage of IndexedDB, didn't manage to get it working yet, we'll see where it ends up. Thanks @jivings for being super helpful!