gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Error "The reference did not exist" while listing branches

Open krlvi opened this issue 1 year ago • 2 comments

Often times this happens on application startup. It has happened to be but also has been reported by users on discord: https://discord.com/channels/1060193121130000425/1073202153163857920/1293975411684016128 https://discord.com/channels/1060193121130000425/1206670506271707156/1295647968803815424

My hypothesis is that this is a race condition getting BranchListingDetails for branches while the app is fetching from the remote

  • upon opening the app, in the left sidebar with branches it is trying to show remote branches, and it is progressively fetching branch details for them
  • at the same time the app is doing a "fetch"
  • some number of those branches were already deleted at the remote, and after the fetch is complete, this is reflected locally too
  • so while the app is fetching branch details, it fails to fetch details for the ones that are now gone

NB: It appears that the error is harmless, but it can be quite noisy especially if there were many merged branches

image

krlvi avatar Oct 15 '24 07:10 krlvi

FYI it seems to happen on every app launch as well, even when there are no changes on remote. See recording: https://cln.sh/XTrhxKPj

anirudhsama avatar Oct 15 '24 08:10 anirudhsama

As one would expect, this is a gitoxide error, but the prefix seems to be added in the frontend, judging from the find_reference() calls in the backend.

This makes me think that the hex-hash prefix is the name of the branch, but I am not sure.

I could look into this if I could get a hint on how to reproduce the issue.

Byron avatar Oct 16 '24 07:10 Byron

@anirudhsama have you noticed these on the most recent release?

krlvi avatar Oct 28 '24 12:10 krlvi

No, this has been fixed. I think it was the same as https://github.com/gitbutlerapp/gitbutler/issues/5229

anirudhsama avatar Oct 29 '24 04:10 anirudhsama

awesome, thanks for letting us know. feel free to ping if you run into any other issues

krlvi avatar Oct 29 '24 07:10 krlvi