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

Typing on the search bar severely slows down N1 #3001

Closed
jstejada opened this issue Oct 31, 2016 · 22 comments
Closed

Typing on the search bar severely slows down N1 #3001

jstejada opened this issue Oct 31, 2016 · 22 comments

Comments

@jstejada
Copy link
Contributor

jstejada commented Oct 31, 2016

This is due to full table scans done on the Contacts table when typing on the search input for the typeahead results, and the fact that DB queries are now synchronous, which blocks the renderer process

@jstejada
Copy link
Contributor Author

incidence here: https://nylas.zendesk.com/agent/tickets/6923

@jstejada
Copy link
Contributor Author

another incidence from @GM-Polyakov

@GM-Polyakov
Copy link
Contributor

consistently crashes for certain search strings

@bengotow
Copy link
Contributor

bengotow commented Nov 1, 2016

Does this crash the renderer process (force a refresh of the N1 window) or totally kill the app? Are there any stack traces? It's one thing for expensive queries to cause jank but they definitely shouldn't be crashing the app...

@jstejada jstejada changed the title Typing on the search bar crashes or severely slows down N1 Typing on the search bar severely slows down N1 Nov 1, 2016
@jstejada
Copy link
Contributor Author

jstejada commented Nov 1, 2016

It doesn't actually crash, it just blocks the process for a very long time and prompts this dialog:

pasted image at 2016_10_31 12_43 pm

I corrected the issue title

@willingc
Copy link

willingc commented Nov 1, 2016

I'm seeing similar behavior when doing a search with N1 on OS X 10.11.6. Seems to have started in the past day or two. Worked just fine prior to that.

  • I've tried leaving it for a long time and keep waiting. Doesn't respond though the pop up clears.
  • The menu items are accessible but do not function if clicked ('File->Close', Developer menu items)

screen shot 2016-11-01 at 10 28 01

@danielbayley
Copy link

danielbayley commented Nov 1, 2016

+1. Searching just crashed N1 for me… I have to say search is generally terrible; to the point where I have to open Apple Mail if I want to actually search for an email!

macOS 10.12.1
N1 0.4.59-cae9ef1

@jstejada
Copy link
Contributor Author

jstejada commented Nov 1, 2016

thanks for reporting @danielbayley. Does N1 completely crash, or does it get stuck like in @willingc's example.

Thanks!

@willingc
Copy link

willingc commented Nov 1, 2016

@jstejada I tried running with Debug selected under the Developer menu. The app gets stuck. No output visible in the developer tools. Does not get to the point of the pop-up.

@willingc
Copy link

willingc commented Nov 1, 2016

A bit more detail...

Running a search on only one mail account seems to work. Display in console:

screen shot 2016-11-01 at 12 29 53

Running search on Inbox (multiple mail accounts) results in runaway log errors in console:

screen shot 2016-11-01 at 12 30 37

Console after popup warning displays:

screen shot 2016-11-01 at 12 31 23

@flyingclimber
Copy link
Contributor

Just had this happen to me as well. Had to restart. Nothing out of the norm in the activity window.

@jstejada
Copy link
Contributor Author

jstejada commented Nov 2, 2016

this should be fixed in f55d996#diff-07549fe21d662401372c62ccc5ce2f50R233 cc @bengotow

@jstejada
Copy link
Contributor Author

jstejada commented Nov 3, 2016

We've released version 0.4.201 which contains a fix for this. Please let us know if you have any other problems. Thanks!

@csampersand
Copy link

csampersand commented Nov 4, 2016

Still happening for me in 0.4.201

image

@willingc
Copy link

willingc commented Nov 4, 2016

@jstejada Just got a chance to test the new release. You may want to reopen this issue as I'm still seeing errors similar to those mentioned by @csampersand. Oddly, it does not seem to do it on all phrases in the same way:

  • a search for 'systers' seems to search correctly but the spinning progress icon in the search bar keeps spinning.
  • a search for 'fernando' freezes the ui and emits errors as seen by @csampersand.

Here are a few screenshots that may help in debugging.

On startup:
screen shot 2016-11-04 at 02 32 48

During 'systers' search
screen shot 2016-11-04 at 02 33 43

screen shot 2016-11-04 at 02 34 08

During 'fernando' search (Note different warnings than when searching for 'systers')
screen shot 2016-11-04 at 02 35 47

screen shot 2016-11-04 at 02 40 43

screen shot 2016-11-04 at 02 41 38

@willingc
Copy link

willingc commented Nov 4, 2016

@jstejada Tested a few more things. If I search when "Inbox" is highlighted, that is when the above happens. Search appears to work great when an individual mailbox is selected before the search. Possibly related to Subscription, maybe?

screen shot 2016-11-04 at 03 01 25

@jstejada
Copy link
Contributor Author

jstejada commented Nov 4, 2016

Hi @willingc, thanks for the additional details! Reopening this issue

@jstejada jstejada reopened this Nov 4, 2016
@jstejada
Copy link
Contributor Author

jstejada commented Nov 4, 2016

Another incidence: https://nylas.zendesk.com/agent/tickets/7003

jstejada added a commit that referenced this issue Nov 4, 2016
This is a temporary fix which adds defensive code to prevent duplicate results
from being returned from the thread search query which causes N1 to enter a loop
and freeze (#3001).

Duplicate results from the search query likely indicate that a thread
was indexed twice, which was not the case before. The cause for this is
still at large.
@nielsvr
Copy link

nielsvr commented Nov 7, 2016

I can replicate the issue. When searching for mail in Nylas the application gets slow and eventually the only way to resume is completely quit Nylas and restart. Searching gets impossible with Nylas.

@nielsvr
Copy link

nielsvr commented Nov 7, 2016

Attached a screenshot from the dev tools. The number left is growing bij 100+ a second

schermafbeelding 2016-11-07 om 21 17 43

@jstejada
Copy link
Contributor Author

jstejada commented Nov 7, 2016

Hi folks! A fix for this has just been released with version 0.4.203. Please let me know if you continue having problems. Thanks for your patience!

@willingc
Copy link

willingc commented Nov 8, 2016

Thanks @jstejada and Nylas team! Tested the latest release from today. Works for individual mailbox as well as consolidated inbox search. Just an FYI the spinning indicator in the search bar will run a while for a large number of emails. With patience the spinning indicator does finish.

Great job on getting this fixed so quickly. Thanks 💐 🍰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants