Repository navigation
Repository indicator improvements - #10119
Conversation
…ory indicator refreshes
We can't trust .name anyway due to minimization
| const shouldFetch = this.shouldPerformFetch(this.repository) | ||
| const shouldFetch = await this.shouldPerformFetch(this.repository) | ||
|
|
||
| if (this.stopped) { |
There was a problem hiding this comment.
Had to add this because of the newly introduced async call above. We could have been stopped in between calling that method and it returning.
rafeca
left a comment
There was a problem hiding this comment.
LGTM!
only thing thing to note is that this will cause the repository updater to run when focusing the application after long periods of inactivity, but I don't think that' an issue since the updater should be quite lightweight in terms of CPU usage (it's actually a nice feature, since we then make sure that we update the repos when the user actually wants to use Desktop and not during inactivity periods).
| const shouldFetch = this.shouldPerformFetch(this.repository) | ||
| const shouldFetch = await this.shouldPerformFetch(this.repository) | ||
|
|
||
| if (this.stopped) { |
Yeah, this is a tough change to make. We don't want to add much work on focus but the way we had it was pretty terrible where it would constantly fetch and call status in the background. I think this is a step in the right direction but we'll need more work here as well as an explicit opt-out (which will come in a later PR). Ideally I'd want to defer refresh on focus for a while but the logic is complex enough now that I'd rather way until we know it's a problem. |
|
@rafeca I made one additional change which was to not refresh repository indicators for the currently selected repository as that's redundant. We already refresh the current repo on focus. |
Description
This is a work-in-progress PR with the intent of reviewing our current logic for repository indicators, improving upon it where necessary, and ultimately making the entire feature itself optional as per our Q1/H1 initiatives
In additional to general cleanup this PR does the following
RepositoryIndicatorUpdatersetIntervalin favor of a proper scheduler which can be paused and which will only schedule its next run after having refreshed all indicators (preventing the possibility of multiple concurrent refreshes if a refresh takes longer than the interval)lastFetcheddate for a repository