Skip to content

Mail list is invalidated at every render #9404

@charlag

Description

@charlag

MailListView queries the list model state on every render:

state: listModel.stateStream(),

And List relies on referential equality of the state:
if (this.state !== attrs.state || this.lastThemeId !== theme.themeId) {

however we do have a getter for the state stream and it's no memoized

get stateStream(): Stream<ListState<Mail>> {
return this.listModel.stateStream.map((state) => {
const newState: ListState<Mail> = {
...state,
items: this.items,
selectedItems: new Set(this.getSelectedAsArray()),
}
return newState
})
}

so we will get a new stream with new state on every call

Test notes

  • Verify mail lists still work (try selecting mails, loading scrolling through large lists, multiple selection, new mail received, etc.)
  • Verify conversation lists still work (try selecting mails, loading scrolling through large lists, multiple selection, new mail received, etc.)

Metadata

Metadata

Assignees

Labels

bugbroken functionality, usability problems, unexpected errorsperformanceperformance related issuesstate:testedWe tested it and are about to release it

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions