-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes keep jumping from my branch to the default branch #4960
Comments
Thanks a lot for reporting! It's sad to see the issue is so spurious. From a quick attempt I can say that it doesn't obviously reproduce - files dragged over to other virtual branches stay there, even when the app is refreshed either by hand or because the worktree changes. Maybe you can find out what affects the issue, as it doesn't seem to always occur. |
hmm, that sounds not so straight forward to pinpoint. is there any piece of code that might move changes from a virtual branch back to the default one? or maybe an operation that "resets" the state of GitButler? I did notice a wider problem that takes form as many symptoms and might be related here, too: once an operation (such as moving changes between branches) starts, it captures (at least) the state of its original branch and if the operation takes a while and other operations are started in the meantime, they will effectively override any previous operations. Maybe this issue manifests here as well? |
What a great idea! Yes, the app is full of race conditions. However, by now we do queue them but maybe the function causing this isn't actually using this system. Typically I only added the system (i.e. a mutex) where a mutation was obvious and could use a long time. CC @Caleb-T-Owens , as he might now better which mutating functions in the application aren't using the exclusive access lock, and are related to moving things between lanes? |
@Byron the |
@TheYarin Thanks for writing in. I'll see if I can find some time this week to shore up our worktree write locks because that is unacceptable. |
Thanks a lot @Caleb-T-Owens for chiming in! This function definitely doesn't grab the lock to serialize it, which explains its raciness. gitbutler/crates/gitbutler-branch-actions/src/actions.rs Lines 291 to 292 in 7dbadb1
It will be quite some work to propagate it to all relevant places, but in return I'd expect all issues like these fixed. On another note, it's interesting how serial the app has become, and that this is a good thing as that makes it deterministic as well. Taking this upon ourselves instead of just using non-async tauri commands seems beneficial overall as it helps differentiate mutating functions from read-only ones in an application that doesn't benefit from Rusts usual rules around mutation as all state lives on disk. |
Glad to see you guys narrowed it down! On another note, I had some suspicion this issue might be triggered by my IDE so I checked and can confirm this happens even when the IDE is closed. |
Version
0.12.25
Operating System
Windows
Distribution Method
msi (Windows)
Describe the issue
I constantly encounter the following bug: I drag changes from the default branch to another branch, and after a few seconds the changes jump back to the default branch. I drag them again, they move, and then after a few more seconds they jump back. I find myself having to quickly commit them before they jump back.
How to reproduce
Not sure, this happens often though
Expected behavior
well, I expect the changes to stay in the branch I put them in.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: