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

Separate folder name from remote folder ID #2729

Closed
philipwhiuk opened this issue Sep 3, 2017 · 3 comments
Closed

Separate folder name from remote folder ID #2729

philipwhiuk opened this issue Sep 3, 2017 · 3 comments
Labels
type: architecture Architecture of the project and high level design type: enhancement New features or improvements to existing features.

Comments

@philipwhiuk
Copy link
Contributor

I've been looking into various folder related issues recently and I've come to the conclusion we need to introduce the concept of remote folder ID.

This will help in the following circumstances:

  1. For Show subfolders as real subfolders in folder list #630 we will be able to use the folder name as the actual name (i.e. Computing.K9 will become K9.
  2. For Support for IMAP shared (not under INBOX) folders #1342 we will be able to uniquely identify folders as to which namespace they are under
  3. For Support newer Exchange servers #606 we will then be able to support EWS which mostly uses a 'unique ID' to reference folders rather than name.

This will impact the following areas of code:

Database Structure

The folders table will have a new column, remoteID

Existing folders will have their current folderName copied to the remoteID column during migration.

Stores

All access to folders will be via the ID, not the name. Hence the folder cache will map from ID to Folder<?>

When the folder list is refreshed (getPersonalNamespaces() [which is by the way a terribly IMAP specific name]) we can update the name of existing folders.

@philipwhiuk philipwhiuk changed the title Separate folder name from folder ID Separate folder name from remote folder ID Sep 3, 2017
@philipwhiuk philipwhiuk added type: architecture Architecture of the project and high level design type: enhancement New features or improvements to existing features. labels Sep 3, 2017
philipwhiuk added a commit that referenced this issue Sep 3, 2017
@philipwhiuk
Copy link
Contributor Author

Just to record what I wrote on IRC:

We currently have 3 versions of identifying the folder:

  • Database ID
  • Folder Name
  • Folder Display Name

We store the Database ID and the FolderName
The Folder Display Name is computer in the FolderInfoHolder class from FolderName and list of special folders.

For example, in IMAP for a given folder we have the following:

IMAP Namespace: "."
DB ID: 3
Folder Name: Spam
Folder Display Name: Spam (Spam)
DB Entry: 3 | Spam

The change I propose changes this to:

IMAP Namespace: "."
DB ID: 3
Folder ID: Spam
Folder Name: Spam
Folder Display Name: Spam (Spam)
DB Entry: 3 | Spam | Spam

3 | Spam | Spam

When we implement multiple namespaces it will change to:

DB ID: 3
Folder ID: /Spam
Folder Name: Spam
Folder Display Name: Spam (Spam)
DB Entry: 3 | /Spam | Spam

and we can support other folders in different namespaces for example:

DB ID: 4
Folder ID: Global/Spam
Folder Name: Spam
Folder Display Name: Spam (Spam)
DB Entry: 4 | Global/Spam | Spam

When then we implement sub folders properly it allow:

DB ID: 4
Folder ID:/Computing.K9
Folder Name: K9
Folder Display Name: K9
DB Entry: 4 | /Computing.K9 | K9

For EWS (which uses unique IDs instead of obvious names) it will allow:

DB ID: 5
Folder ID: abcd134
Folder Name: Inbox
Folder Display Name: Inbox
DB Entry: 5 | abcd134 | Inbox

@philipwhiuk
Copy link
Contributor Author

Progress on this is going fairly well. I have a build on my phone that mostly works but I need to tidy it up a lot and make sure everything works as expected:

I've run into a few walls which I'm knocking down as I go:

My remoteFolderId branch is pushed but I'm still tidying it up, so it'll probably see a decent amount of rebasing before I get to PR territory.

@cketti
Copy link
Member

cketti commented Oct 5, 2020

This work has been completed.

For folder hierarchy support see #630.

@cketti cketti closed this as completed Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: architecture Architecture of the project and high level design type: enhancement New features or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants