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

Code path for getting package metadata calls into CreateCacheFileAsync while running on the UI thread #4739

Merged
merged 2 commits into from
Jul 29, 2022

Conversation

jebriede
Copy link
Contributor

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/1767

Regression? Last working version: N/A

Description

One particular code path was transitioning to the UI thread while getting package metadata because it needed access to the UI property for the selected package source. Rather than transitioning to the UI thread for each package, we cache the selected package source and pass it as an argument before getting off the UI thread, so we don't need to transition back each time.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added

    • OR
      Manually tested the scenario of loading packages in the PMUI browse tab and installing and uninstalling a package. Also verified with a PerfView trace that this particular code path is no longer running on the UI thread.

    • Test exception

    • OR

    • N/A

  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@jebriede jebriede requested a review from a team as a code owner July 27, 2022 22:25
@jebriede jebriede changed the title Fix a code path that calls into CreateCacheFileAsync from running on the UI thread Code path for getting package metadata calls into CreateCacheFileAsync from running on the UI thread Jul 27, 2022
nkolev92
nkolev92 previously approved these changes Jul 27, 2022
Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

One suggestion you can consider.
I'm comfortable with whatever direction you choose.

@jebriede jebriede changed the title Code path for getting package metadata calls into CreateCacheFileAsync from running on the UI thread Fix code path for getting package metadata calls into CreateCacheFileAsync from running on the UI thread Jul 27, 2022
@jebriede jebriede changed the title Fix code path for getting package metadata calls into CreateCacheFileAsync from running on the UI thread Code path for getting package metadata calls into CreateCacheFileAsync while running on the UI thread Jul 27, 2022
@jebriede jebriede requested a review from nkolev92 July 29, 2022 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants