gitbutler
gitbutler copied to clipboard
Fix issue with `isFetching` staying true due to incorrect check for `total_count` being 0 after creating a PR
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
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.
That's perfect, thank you.
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.
Fixed here https://github.com/gitbutlerapp/gitbutler/pull/3199