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

Fix Notification Text Initialization #2926

Merged

Conversation

CoolSpy3
Copy link
Contributor

@CoolSpy3 CoolSpy3 commented Nov 3, 2024

  • I have read the contributing guidelines, and I agree with the Code of Conduct.
  • Have you checked that there aren't other open pull requests for the same changes?
  • Have you tested that the committed code can be executed without errors?
  • This PR is not composed of garbage changes used to farm GitHub activity to enter potential Crypto AirDrops.
    Any user suspected of farming GitHub activity with crypto purposes will get banned. Submitting broken code wastes the contributors' time, who have to spend their free time reviewing, fixing, and testing code that does not even compile breaks other features, or does not introduce any useful changes. I appreciate your understanding.

Currently, there is a bug where the notifications for updating packages (and likely related operations) have the text "THIS NEEDS TO BE REDEFINED ON THE CONSTRUCTOR". After some digging, it looks like this is because INSTALLING_STRING is set in the constructors of AbstractOperation implementations, but AbstractOperation tasks are started asynchronously by the PackageOperation and SourceOperation constructors. This means that the tasks are started before the subclass constructor is run, leading to a race condition. This PR moves the string initialization in all the places I could find it to the Initialize() function, which is always run before the task.

I was able to successfully test this for package updates and removing a manager source. However, because I am not familiar enough with the codebase to setup a reliable way to show an arbitrary notification, and the actual notifications disappear fairly quickly, it is difficult for me to run more in-depth tests on all cases.


I didn't find an open issue for this, but if there is one, feel free to link it!

@marticliment
Copy link
Owner

I don't think there was an issue for it, but I recall having experienced this bug once or twice...

Thanks for the fix! I will have your PR merged in 1 or 2 weeks approx.

@marticliment marticliment merged commit 983dd66 into marticliment:main Nov 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants