runbox7 icon indicating copy to clipboard operation
runbox7 copied to clipboard

#Mail Mail viewer - showingSearchResults is always true

Open castaway opened this issue 5 years ago • 2 comments

This is an internal / code complexity issue. app.component.ts has a lot of code for either showing search results (when showingSearchResults is true), or displaying pure message lists from the API without filtering. My recent poking at #19 reveals that showingSearchResults is never false - as long as the search box is displayed, updateSearch(), which doesn't check for there being any text in the searchText field, sets showingSearchResults to true.

I tried making it only update search results if searchText wasn't empty, resulting in forcing it to use messagelistservice messages instead, and that looked a mess, suggesting that view hasnt been used/tested in a while. (see resetColumns for eg, which picks column lists from one or the other (or websocket)).

My main question is, is this on purpose/sensible? If so we can ditch a bunch of the messagelistservice messagelist managing code, as its unused. If not we should fix the issue and the associated bugs in the messagelist code.

castaway avatar Aug 06 '20 10:08 castaway

I suspect the reason is that when the local index is enabled it's used to show the message list, whereas the database generated list is really a fallback.

gtandersen avatar Apr 28 '21 10:04 gtandersen

Could be - I'd be tempted to rename the variables then, so it looks like we did it on purpose (aka makes more sense to future maintainers/contributors..)

castaway avatar May 04 '21 08:05 castaway