Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save special folder mapping and fetch folder list after creating account #7443

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

cketti
Copy link
Member

@cketti cketti commented Dec 19, 2023

To save special folders we use the same mechanism that is used when importing server settings. The server IDs of the special folders are saved in Account.imported*Folder. Then the first time the folder list is synced, SpecialFolderUpdater will map those server IDs to the database IDs for the folder and call Account.set*FolderId().

Closes #7329
Closes #5826

@cketti cketti requested a review from wmontwe January 2, 2024 12:46
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this solves the issues mentioned, it adds complications:

The MessagingController is already huge (2.7k loc) and should be broken into smaller, more manageable modules. Where each module should have a single responsibility, making it easier to understand, maintain, and test.

Adding the MessagingController as direct dependency of AccountCreator, renders all efforts of making it testable obsolete/harder. It would help to introduce an interface that masks the complexity to the one necessary for account creation.

The special folder handling whitin the AccountCreator could also be moved to another class and tested individually.

The goal is not only to fix immediate issues but also to make the codebase more maintainable and adaptable for future changes. Remember, the key to successful refactoring is to balance immediate functional improvements with long-term code health. Idealy this is applied whenever code is touched. Each change should make the system a little more modular, understandable, and testable, aligning with the goal of a more maintainable and adaptable codebase.

@cketti cketti merged commit aae41a9 into main Jan 3, 2024
2 checks passed
@cketti cketti deleted the fetch_folder_list_after_creating_account branch January 3, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync folder list after creating an account Prompt users to configure special folders during account setup
2 participants