[
{
"messageId": "mid1",
"timestamp": 1609459200,
"preview": "Hey, just wanted to check in on the project",
"subject": "Project update",
"to": "uid1",
"from": "uid2",
"threadId": "threadId1"
},
{
"messageId": "mid2",
"timestamp": 1609545600,
"preview": "Looks good to me, let's move forward",
"subject": "Re: Project update",
"to": "uid2",
"from": "uid1",
"threadId": "threadId1"
},
{
"messageId": "mid3",
"timestamp": 1609632000,
"preview": "Thanks for getting back to me. I've attached the updated proposal",
"subject": "Re: Project update",
"to": "uid1",
"from": "uid2",
"threadId": "threadId1"
}
]
(note the mid
field)
[
{
"messageId": "mid9",
"timestamp": 1609459200,
"preview": "Hey, just wanted to check in on the project",
"subject": "Project update",
"to": "uid1",
"from": "uid2",
"threadId": "threadId1"
},
{
"messageId": "mid10",
"timestamp": 1609545600,
"preview": "Looks good to me, let's move forward",
"subject": "Re: Project update",
"to": "uid2",
"from": "uid1",
"threadId": "threadId1"
},
{
"messageId": "mid11",
"timestamp": 1609632000,
"preview": "Thanks for getting back to me. I've attached the updated proposal",
"subject": "Re: Project update",
"to": "uid1",
"from": "uid2",
"threadId": "threadId1"
}
]
Collection EmailThreads:
[Subcollection threadId1]
[Array participants]: ['uid1', 'uid2']
[Array uid1]: ['mid1', 'mid2', 'mid3']
[Array uid2]: ['mid9', 'mid10', 'mid11']
[Map subject]: {
'default': 'Project update',
'uid1': 'Custom Subject',
// uid2 did not change their subject, so they get default
}
[Subcollection MetaMessages]: (we'll deal with this later)