-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Race condition in the program during cut / paste #571
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Describe the bug
On a cut and paste operation, there is a race condition that causes the
model.copyItems
content to reset to old state containing the file that was removed by cut. It causes errors in logs. I think it could lead to some user facing issue as well.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Clipboard content should get cleaned. Clipboard render function should not be looking for old file.
Screenshots
If applicable, add screenshots to help explain your problem.
( Modified with more logs )

( Here you can see, that Update() function ends before pasteItems() goroutine that it started is finished )

System information (please complete the following information):
I have tried to do some research on this. Spend around 3-4h+ 😅
The paste goroutine call takes time, and sometimes it happens after Update() has been finished and
m
with originalm.copyItems
has been returned to bubbletea. Even ifm.
copyItems would get clear at the end ofpasteItems
, the nextUpdate()
would use a newm
with originalm.copyItems
.This is not going to be easy to fix. But I will try to take a stab at this after
The text was updated successfully, but these errors were encountered: