linagora / esn-frontend-inbox

Webmail SPA for the OpenPaaS Suite - https://open-paas.org
Other
12 stars 19 forks source link

Migrate to use Mailbox/changes of jmap-client-ts without altering the current behavior #391

Open fabienmoyon opened 3 years ago

fabienmoyon commented 3 years ago

Story

390 As a user I want to reduce the amount of data when getting mailboxes

Subtasks

402 Get all mailboxes only when changes on polling 403 Only get needed mailboxes on polling

Currently

Currently at the loading page, we get mailboxes and each 10min we get again mailboxes to to update them.

Expected

After the first get mailboxes keep the current behavior but this time we use Mailbox/changes to efficiently update the state of mailboxes cache to match the new state on the server.

SPEC

https://jmap.io/spec-core.html#changes

alagane commented 3 years ago

use_jmap_changes_for_polling

On the left, there is 1 request, but it is fetching every mailboxes.

On the right there are at most 2 requests, but they are only fetching differences, and most of the time there will be no changes so it will be only 1 request.

When the backreferences will be implemented, the number of http requests might be reduced to 1 (instead of 2) merging the changes and the get.

chibenwa commented 3 years ago

Do we need to cut this in smaller issues? And how?

chibenwa commented 3 years ago

When the backreferences will be implemented, the number of http requests might be reduced to 1 (instead of 2) merging the changes and the get.

When the backreferences will be implemented, the number of http requests can be reduced to 1 (instead of 2) merging the changes and the get.

alagane commented 3 years ago

When the backreferences will be implemented, the number of http requests might be reduced to 1 (instead of 2) merging the changes and the get.

When the backreferences will be implemented, the number of http requests can be reduced to 1 (instead of 2) merging the changes and the get.

I was wondering if if we want to check for 2 new mailboxes (like 1 created and 1 updated) from the last state, that would need 3 methods (in 1 request) with backreferences, and 2 methods (in 2 requests) without backreferences. The verb can is more apropriate anyway, even if we chose to still use 2 requests.

But I think this discussion is out of scope.

chibenwa commented 3 years ago

I was wondering if if we want to check for 2 new mailboxes (like 1 created and 1 updated) from the last state, that would need 3 methods (in 1 request) with backreferences

That is what LTTRS JMAP client does, yes.

But I think this discussion is out of scope.

Agreed.

Do we need to cut this in smaller issues? And how?

(to be annoying) - this wasn't answered...

alagane commented 3 years ago

Do we need to cut this in smaller issues? And how?

I think this issue does not need to be cut into smaller issues.

chibenwa commented 3 years ago

I think this issue does not need to be cut into smaller issues.

Ok. Easy then. But yet you can not hand this task to a new comer as is...

Can we then add details on how to do it? Are there a succession of steps to follow?

Where is located today the mailbox refreshing logic?

Maybe which module/file would need to be changed?

alagane commented 3 years ago

I think this issue does not need to be cut into smaller issues.

Ok. Easy then. But yet you can not hand this task to a new comer as is...

Can we then add details on how to do it? Are there a succession of steps to follow?

Where is located today the mailbox refreshing logic?

Maybe which module/file would need to be changed?

I think this work has to be done on the task and not before. I do not know these informations yet.

chibenwa commented 3 years ago

While discussing during the daily with Rachid I figured out a way to cut this ticket in smaller parts:

Step 1:

This evolution of Step 1 is smarter as we always avoid reading all mailboxes after the initial loading...

I thus propose that @alagane and Rachid you work on the step 1 first.