-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Process events before PerformRefreshRevisions #9906
Conversation
Review comment: simpler and still works
@@ -596,6 +596,9 @@ private void RefreshRevisions(Func<RefsFilter, IReadOnlyList<IGitRef>> getRefs) | |||
return; | |||
} | |||
|
|||
// Process events e.g. from closing FormProcess, particularly after rebase / conflict resolution actions | |||
Application.DoEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a "smell", meaning we're doing something wrong...
Can Invoke
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a "smell", meaning we're doing something wrong...
Yes, but what?
Can
Invoke
instead?
No, Invoke((Action)(() => RevisionGrid.PerformRefreshRevisions(getRefs)));
does not suffice.
And this is no surprise because UICommands_PostRepositoryChanged
is executed in the UI thread already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is no surprise because
UICommands_PostRepositoryChanged
is executed in the UI thread already.
Perhaps this is the underlying problem - we use this event for I/O, and not just for the UI updates.
I'm not asking for a change, just making an observation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thinking out loud - may be we need to have two events - one is fired on a background thread for I/O (UICommands_PostRepositoryChanged
) and another one (DataRefreshed
) - one the UI thread for the UI updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highly recommend not using DoEvents Async code over DoEvents. DoEvents introduces rentry problems. |
Fixes #9223
Fixes #9792
Proposed changes
RevisionGrid.PerformRefreshRevisions
:RevisionGridControl._isRefreshingRevisions
before callingLoadingCompleted
andSetPage
RevisionGraph.Clear
: clear Dictionary instead of creating a new oneScreenshots
Before
no graph or empty RevisionGrid after rebase / merge / conflict resolution operations
After
RevisionGrid is updated without need for manual refresh
Test methodology
Test environment(s)
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.