Repository navigation
Conversation
What changed: - Return null when protected branch requests fail. - Skip cache updates for inconclusive refreshes while preserving successful empty results. - Cover populated, empty, network failure, and not found responses. Why: - Prevent transient or ambiguous API failures from clearing cached branch protection state. Alternatives considered: - Treat 404 as no protected branches, but GitHub can use 404 for inaccessible private resources. - Let the API throw, but the background refresh should handle inconclusive results without mutating state.
tidy-dev
approved these changes
Aug 19, 2026
tidy-dev
left a comment
Contributor
There was a problem hiding this comment.
✨ Thanks for the fix. Seems reasonable. :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #7864
Description
fetchProtectedBranchespreviously returned an empty array both when a request succeeded without protected branches and when the request failed. This caused temporary or ambiguous API failures to clear the last-known branch protection information.This PR:
nullwhen the protected branches request cannot be completed;removed branch protections to clear the cache; and
A 404 is treated as inconclusive because GitHub may return it for inaccessible private resources as well as missing repositories. Preserving the last-known state is safer than recording that the repository has no protections.
Testing
yarn testyarn lintyarn compile:devRelease notes
Notes: [Fixed] Preserve existing branch protection information when GitHub API requests fail - #7864