thunderbird / thunderbird/thunderbird-android
RFC: Revise Store/Folder/Message interface
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 14k
- Forks
- 2.8k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 57
Description
Originally, K-9 Mail's design for the Store/Folder/Message classes was based on the JavaMail API. Over the years we modified our classes a lot but never threw away the parts that didn't work well for K-9 Mail.
I want to change this. Specifically, I want 'modules' to return objects that contain exactly the data that is needed by the caller. And to avoid lazy-loading or additional requests as much as possible.
Some ideas:
- Get rid of
LocalStoreandLocalFolder. Treating the database like a remote store only causes us pain and requires
lots of boiler plate code.- Create a new interface and refer to messages by its database ID instead of using
MessageReference. - Hand specialized value classes to UI; containing only data necessary to render the UI.
- Create a new interface and refer to messages by its database ID instead of using
- Extract a class from
Messagethat contains state information (flags, server uid, folder, etc.).Messageshould
only be concerned with storing the message data (header + body). This should also allow us to get rid of most if not
all checked exceptions onMessagemethods. - Simplify
StoreandFolderinterfaces. We have very specialized needs for synchronization. All other use cases are
secondary. - The way we synchronize messages is rather specific to the
Storetype. We probably want to move away fromStore
feature flags to separate synchronization implementations.
Having a very specialized interface will make k9mail-library even less useful for others. Later, we probably want to extract another library with just the basic operations for remote stores. But for now that shouldn't be our concern.
I'd love to get everyone's comments on these ideas or even alternative suggestions on how to improve the current situation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by mapping the Store, Folder, Message, LocalStore, LocalFolder, and MessageReference classes or interfaces in k9mail-library. Review the RFC and surrounding implementation to define an agreed interface redesign; this issue does not specify a concrete implementation or completion test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100