Skip to content
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

The Discard Changes button hangs #7950

Open
JoyHak opened this issue Apr 2, 2025 · 8 comments
Open

The Discard Changes button hangs #7950

JoyHak opened this issue Apr 2, 2025 · 8 comments
Labels
bug Something isn't working os:windows The Windows platform

Comments

@JoyHak
Copy link

JoyHak commented Apr 2, 2025

Version

0.14.13

Operating System

Windows

Distribution Method

msi (Windows)

Describe the issue

The Discard Changes button hangs periodically without any visible warning or message. A message with a question remains on the screen until canceled and sometimes hangs after restarting GitButler.

I didn't see any reason or pattern: sometimes it hangs if I try to undo changes in locked files. Sometimes it hangs in large branches.

Image

How to reproduce (Optional)

  1. Cancel a commit or make changes to any file
  2. Open context menu
  3. Click Discard Changes
  4. See the issue and no response at all

Expected behavior (Optional)

  1. Cancel a commit or make changes to any file
  2. Open context menu
  3. Click Discard Changes
  4. See an error message or other warning.
  5. Force ignore changes regardless of the warning

Relevant log output (Optional)

@JoyHak JoyHak added the bug Something isn't working label Apr 2, 2025
@Byron Byron added the os:windows The Windows platform label Apr 3, 2025
@Byron
Copy link
Collaborator

Byron commented Apr 3, 2025

Thanks a lot for reporting!

It would be interesting to know if there is high CPU when it hangs. If not, it's very likely that the backend panicked which will leave the UI waiting forever without a sign that this happened, except for in the logs.

Discarding files was also completely rewritten, and it's will be available with the next major release.

@JoyHak
Copy link
Author

JoyHak commented Apr 3, 2025

Upd: I can't Discard changes, Discard line and Discard hunk in locked file. There's no any errors and messages

GitButler.2025-04-03.log

Image

@JoyHak
Copy link
Author

JoyHak commented Apr 3, 2025

Thanks a lot for reporting!

It would be interesting to know if there is high CPU when it hangs. If not, it's very likely that the backend panicked which will leave the UI waiting forever without a sign that this happened, except for in the logs.

Discarding files was also completely rewritten, and it's will be available with the next major release.

no high cpu, no messages in logs (see new comment)

@Byron
Copy link
Collaborator

Byron commented Apr 3, 2025

Thanks for taking a look.

And right, without high CPU I think panics are only (and really) be visible in the tokio logs though (next to the application logs).

@JoyHak
Copy link
Author

JoyHak commented Apr 4, 2025

I've tried to discard changes in empty branch:

Image

Tokio:

{"Exit":{"id":6756498952683545,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":484481400}}}
{"Enter":{"id":6756498952683545,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":484491400}}}
{"Exit":{"id":6756498952683545,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":484493700}}}
{"Close":{"id":6756498952683545,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":484494900}}}
{"Exit":{"id":58547894667444251,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":485494500}}}
{"Enter":{"id":58547894667444251,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":485504200}}}
{"Exit":{"id":58547894667444251,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":485506300}}}
{"Close":{"id":58547894667444251,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":485507700}}}
{"Exit":{"id":29274497089536026,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":695259100}}}
{"Enter":{"id":29274497089536026,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":695269400}}}
{"Exit":{"id":29274497089536026,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":695271500}}}
{"Close":{"id":29274497089536026,"at":{"secs_since_epoch":1743756833,"nanos_since_epoch":695272600}}}

last log:

2025-04-04T08:53:53.436049Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: new id=414c02e1-fbdc-4021-b686-35b93458c777 window="main" project_id=414c02e1-fbdc-4021-b686-35b93458c777
2025-04-04T08:53:53.459374Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: close time.busy=23.3ms time.idle=39.3µs id=414c02e1-fbdc-4021-b686-35b93458c777 window="main" project_id=414c02e1-fbdc-4021-b686-35b93458c777 fs_events=722 fs_events=722 ignored=0 ignored=0 git_noop=700 git_noop=700 git=2 git=2 project=1 project=1 git_dedup=2 git_dedup=2 project_dedup=1 project_dedup=1
2025-04-04T08:53:53.459527Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:55: new event=GitFileChange(414c02e1-fbdc-4021-b686-35b93458c777, index, logs\HEAD)
2025-04-04T08:53:53.459610Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:55: new event=ProjectFileChange(414c02e1-fbdc-4021-b686-35b93458c777, QuickSwitch-1.4.ahk)
2025-04-04T08:53:53.459790Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:55: new event=GitButlerOplogChange(414c02e1-fbdc-4021-b686-35b93458c777)
2025-04-04T08:53:53.463903Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:55: close time.busy=4.36ms time.idle=11.0µs event=GitFileChange(414c02e1-fbdc-4021-b686-35b93458c777, index, logs\HEAD)
2025-04-04T08:53:53.464586Z  INFO handle:project_files_change: crates\gitbutler-watcher\src\handler.rs:146: new event=ProjectFileChange(414c02e1-fbdc-4021-b686-35b93458c777, QuickSwitch-1.4.ahk) paths=1
2025-04-04T08:53:53.464920Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:55: close time.busy=5.12ms time.idle=12.4µs event=GitButlerOplogChange(414c02e1-fbdc-4021-b686-35b93458c777)
2025-04-04T08:53:53.650211Z  INFO handle:project_files_change:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:105: new event=ProjectFileChange(414c02e1-fbdc-4021-b686-35b93458c777, QuickSwitch-1.4.ahk) paths=1
2025-04-04T08:53:53.674288Z  INFO handle:project_files_change:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:105: close time.busy=24.0ms time.idle=35.4µs event=ProjectFileChange(414c02e1-fbdc-4021-b686-35b93458c777, QuickSwitch-1.4.ahk) paths=1
2025-04-04T08:53:53.674355Z  INFO handle:project_files_change: crates\gitbutler-watcher\src\handler.rs:146: close time.busy=210ms time.idle=22.4µs event=ProjectFileChange(414c02e1-fbdc-4021-b686-35b93458c777, QuickSwitch-1.4.ahk) paths=1
2025-04-04T08:53:53.674712Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:55: close time.busy=215ms time.idle=26.7µs event=ProjectFileChange(414c02e1-fbdc-4021-b686-35b93458c777, QuickSwitch-1.4.ahk)
2025-04-04T08:53:54.438604Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: new id=414c02e1-fbdc-4021-b686-35b93458c777 window="main" project_id=414c02e1-fbdc-4021-b686-35b93458c777
2025-04-04T08:53:54.438758Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: close time.busy=112µs time.idle=44.4µs id=414c02e1-fbdc-4021-b686-35b93458c777 window="main" project_id=414c02e1-fbdc-4021-b686-35b93458c777 fs_events=15 fs_events=15 ignored=0 ignored=0 git_noop=15 git_noop=15 git=0 git=0 project=0 project=0

@Byron
Copy link
Collaborator

Byron commented Apr 4, 2025

That's really interesting - I don't even see the discard call in the logs. This might be accidental, but from what's presented here the UI does nothing when the button is pressed.
If that were the case, there might be an error in the javascript console? It should be available via View -> Developer Tools.

@JoyHak
Copy link
Author

JoyHak commented Apr 4, 2025

Well, you're right! I can generate an error on click. But Discard hunk does nothing. No errors, logs and actions.

Image

Image

@Byron
Copy link
Collaborator

Byron commented Apr 5, 2025

Maybe that's the lead we were looking for!
My feeling is that the code first tries to close the window before performing the actual action maybe, and as the closing fails nothing material happens?
Maybe @estib-vega knows more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os:windows The Windows platform
Projects
None yet
Development

No branches or pull requests

2 participants