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
Only show each thread once per message list #4970
Only show each thread once per message list #4970
Conversation
As discussed last week those operations might not actually need special handling. The existing sync logic should be able to see that a new message is "added" to the list. What we might have to change is the sync logic for new messages. Right now we consider all messages with a higher UID than highest known UID as new. What we can do instead is consider all messages as new whose UID is higher than the lowest known UID and not in the list of known UIDs already. Then you can also detect "new" messages that pop up in the middle of the previous message list. |
fac22ca
to
96cc26b
Compare
Peek.2021-05-04.16-27.mp4Case 1: Delete the latest message in a thread. The message is removed from the envelope list but none of the other messages show up. I'm not sure yet if changing the findNewIds method is possible. Right now we take the known id's, find the max uid (on master) / max sent_at (this branch) and query for all messages > max uid/sent_at. As suggest we may change max to min uid/sent_at of the known id's. This will not work for my example case as the known id's are a few. However if a user has more than 20 messages it should work. In addition we could lookup the envelopes store on message delete if there is another message of the same thread and add it to visible envelopes list. |
cd141ea
to
d1682e8
Compare
86f6d4b
to
53a63d6
Compare
View Delete Move |
src/store/actions.js
Outdated
@@ -770,4 +771,16 @@ export default { | |||
tagId: tag.id, | |||
}) | |||
}, | |||
async deleteThread({ getters, commit }, { envelope }) { | |||
commit('removeEnvelope', { id: envelope.databaseId }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The envelope to remove is the envelope in the list (e.g. the newest/latest message in a thread). If the other envelopes of a thread are loaded we still have references in other vuex stores (e.g. mailbox.envelopeLists). removeEnvelope mutation has a check if the envelope to remove is a "mounted" envelope and does not remove references for "unmounted" envelopes.
0667e6b
to
9a911bf
Compare
01c1319
to
7a2823b
Compare
src/components/EnvelopeList.vue
Outdated
deleteAllSelected() { | ||
this.selectedEnvelopes.forEach(async(envelope) => { | ||
async deleteAllSelected() { | ||
for (const envelope of this.selectedEnvelopes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change forEach
to for...of
is not necessary for the threading improvements. forEach
is not blocking. If a user selects 10 threads / messages we emit 10 xhr request. for...of
will process the selected envelopse sequentially. Ideally would be a "loading" state to signal that mail is working on something.
src/components/MoveModal.vue
Outdated
id, | ||
destMailboxId: this.destMailboxId, | ||
}))) | ||
for (const envelope of envelopes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change Promise.all
to for...of
is not necessary for the threading improvements. Promise.all
will dispatch a moveMessage / moveThread action for each envelope passed to the MoveModal. Ideally would be a "loading" state to signal that mail is working on something.
874c7ac
to
f97fc51
Compare
lib/Db/MessageMapper.php
Outdated
); | ||
|
||
$qb->select('id') | ||
->from($this->getTableName()) | ||
$select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Chunking
in
statements for Oracle Compliance #4947 introduced chunking for in expressions. I need to check the findNewIds query to make sure it still works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested this PR on my local instance and here are some things I noticed:
- Deleting the most recent message from a thread in the thread envelope view will make the thread disappear from the list. Triggering a sync will make the thread reappear.
- A thread is still shown after moving it to another folder, switching to a third folder and then back again. It will be shown in both mailboxes a the same time. Moving the thread back to the original folder will show it twice in the list. A page reload will fix the duplication.
- Marking a thread important using the context menu of an envelope in the list will not change the label of the button (
Mark important
->Mark unimportant
).
I only looked at the code briefly.
PS: I tested f97fc51. The most recent commit on this branch will trigger an internal server error upon visiting the mail app.
EDIT: Removed an unreproducible issue.
e812d50
to
fbec019
Compare
Fixes #3652
Todo
1 Is done by the existing sync backend request