app-stats-action icon indicating copy to clipboard operation
app-stats-action copied to clipboard

Error handling improvement

Open wei opened this issue 5 years ago • 9 comments

The action failed here.

It looks like a user have removed the installation between the time installations are fetched and repos are fetched for that installation.

Can be fixed by wrapping a try catch around:

https://github.com/gr2m/app-stats-action/blob/49681496387bc37309e369f04ad30b4f27a13f35/lib/app-stats.js#L49-L71

wei avatar Aug 28 '20 22:08 wei

Thanks Wei! Could you check if the installation (id: 5701088) has indeed been removed? Did you try to re-run the build?

It might be worth adding a check in case of a 404 if the installation was removed, and ignore in this case, but throw an error in another case.

gr2m avatar Aug 29 '20 00:08 gr2m

I ran

    const installationOctokit = new Octokit({
      auth: {
        id,
        privateKey,
        installationId: 5701088,
      },
    });

and got 404. Tried with a good installation id had no issues 😃 .

The rerun of had no issues either.

wei avatar Aug 29 '20 20:08 wei

Another example 😃

wei avatar Sep 01 '20 03:09 wei

Okay, I agree we should handle that error better.

I would suggest we check if the installation still exists in case of a 404, in case it doesn't, do nothing

gr2m avatar Sep 05 '20 19:09 gr2m

hey @wei would you like to send a PR for this change?

gr2m avatar Dec 15 '20 01:12 gr2m

I haven't gotten time to do it (just been ignoring the workflow failure emails). I can take a shot when I have some time~ 😜

wei avatar Dec 15 '20 22:12 wei

no rush, it seems like you are the only one affected so far. I guess your pull app is just much more popular than our apps :D

gr2m avatar Dec 16 '20 00:12 gr2m

Or people actually like your apps and don't uninstall it 😂

wei avatar Dec 16 '20 00:12 wei

It seems like I haven't encountered this in the last many months so I have not spent any time on this : ) I'll put this in the back burner for now.

wei avatar Nov 22 '21 01:11 wei