gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Fix issue with `isFetching` staying true due to incorrect check for `total_count` being 0 after creating a PR

Open gitbutler-client opened this issue 11 months ago • 3 comments

Right, I can repro. ~~Something other than the obvious was broken, isFetching remains true.~~

*edit: I actually can't, I just thought my button was disabled as well. A problem here is we do retries (for roughly 10 seconds) if checks.total_count == 0. This is obviously not great, but at the time of implementing total_count can be incorrectly 0 just after creating a PR.

via: @mtsgrd

https://discord.com/channels/1060193121130000425/1206670506271707156/1217234125690507304

gitbutler-client avatar Mar 12 '24 22:03 gitbutler-client

In the GitHub service.ts before retrying for several seconds if the checks.check_total == 0, it would be good to check if there are any testing suites setup for that repo.

The check-suites endpoint when given the trunk branch name as the ref should return a similar check_total value for how many testing suites are setup for that branch (if I understand the docs correctly. I have not tested this). This value could probably be cached in local storage and only updated whenever GB checks for changes on the remote so that the app knows ahead of time if calculating check info is even necessary.

KroniK907 avatar Mar 13 '24 00:03 KroniK907

That's perfect, thank you.

mtsgrd avatar Mar 13 '24 11:03 mtsgrd

We discussed this briefly with @mtsgrd today. It seems there should be an additional 'Checks' status displayed during loading. For simplicity, we could display a gray button labeled 'Checks (spinner icon),' with the option to include different tooltip if we want to elaborate this.

image

PavelLaptev avatar Mar 13 '24 11:03 PavelLaptev

Fixed here https://github.com/gitbutlerapp/gitbutler/pull/3199

mtsgrd avatar Mar 20 '24 01:03 mtsgrd