When someone sends you a message, it gets stored in the appendable data corresponding to the hash of your email ID. When you refresh your inbox folder, the app fetches your appendable data and returns all the emails it contains.
Contents
Get the appendable data of the inbox folder
The app needs to obtain an appendable data handle.
Get a data identifier handle
First, the app fetches a data identifier handle for the appendable data representing your inbox folder.
If the data length is 0, it means your inbox is empty.
Iterate through the appendable data
If the data length is greater than 0, the app iterates through the appendable data. It starts at index 0 and fetches the data identifier corresponding to the first email.
For each email in the appendable data, the app needs to retrieve the corresponding immutable data.
Get an immutable data reader handle
The app fetches the data map of the email using the data identifier handle previously obtained. The data map is decrypted using the asymmetric keys of the app.
The app adds the content of the email to your inbox and then repeats this process for the next email (if there is one). It continues iterating through the appendable data until all your emails have been fetched.
Get the size of the appendable data
Your appendable data has a maximum size of 100 KiB. To update the amount of space used by the emails in your appendable data, the app fetches the serialized content of your appendable data and measures its size.