Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Fix crash when text entered into pull request search box - #2174

Merged
jcansdale merged 3 commits into
masterfrom
fixes/2149-search-box-crash
Jan 14, 2019
Merged

jcansdale merged 3 commits into
masterfrom
fixes/2149-search-box-crash

Conversation

@jcansdale

Copy link
Copy Markdown
Collaborator

What this PR does

The OnStartSearch method is called on a background thread which was causing the new ThreadHelper.ThrowIfNotOnUIThread() call to throw (and crash Visual Studio). The check was correct and appears to also show the reason #1950 was necessary.

  • Marshal OnStartSearch onto the UI thread before updating IGitHubPaneViewModel
  • Remove workaround in UpdateSearchHost which was necessary because of this issue

How to test

  1. Open PR list pane and enter a search term
  2. Expect the filter to work and not crash
  3. Add some spaces to the end of the search term
  4. Expect the filter to work and not crash
  5. The spaces will now be trimmed and the search box updated

Fixes #2149

OnStartSearch is called on a background thread. Marshal onto UI thread
when updating view model.
Now that OnStartSearch is updating IGitHubPaneViewModel on the UI
thread, calling SearchAsync with a duplicate query no longer crashes.
We no longer need to trim whitespace and compare.

@grokys grokys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and fixes the crash! 👍

@jcansdale
jcansdale merged commit d05ee40 into master Jan 14, 2019
@jcansdale
jcansdale deleted the fixes/2149-search-box-crash branch January 14, 2019 16:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants