Skip to content

improve error handling of protected branches API call #7864

Closed

Description

@shiftkey

Please describe the problem you think should be solved

@niik raised an excellent point at the end of #7826

My only remaining concern now is with how we're dealing with failed API requests. Consumers of the fetchProtectedBranches method have no way of differentiating between an API request that returned zero protected branches and one that failed meaning that if we attempt to refresh the list of protected branches while there's no internet connectivity we'll immediately clear the internal list of protected branches. Given that this is a pre-existing behavior I don't think it should hold up this PR but I feel like it warrants further investigation to determine if that's the behavior we want.

[Optional] Do you have any potential solutions in mind?

We should preserve the list of cached protected branches if the API call fails due to an intermittent network issue. But I think we need to be mindful of other cases here (e.g. 404) and ensure the app handles them correctly.

Activity

  1. added
    not-planned
    help wanted
    on Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantednot-planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions