-
-
Notifications
You must be signed in to change notification settings - Fork 746
Add dynamic tray menu update functionality #973
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
Conversation
|
Must be rebased to |
c8a3578 to
c5ebf95
Compare
|
rebase done |
|
For me this is fine - I'd like to have @softworkz opinion especially regarding potential cleanups / memory leaks on this one. |
c5ebf95 to
6508c00
Compare
Yeah, I thought about leaks too, but I think it is safe. The c# sides socket callback gets remove fist ( On the node side, replacing the trays menu via In any case, if @softworkz can look at it as well, that would be super. |
6508c00 to
ea3a39b
Compare
Introduced a `SetMenuItems` method in `Tray.cs` to enable updating the tray's context menu dynamically. This method clears existing menu items, adds new ones, and registers click handlers. Added XML documentation for the method.
ea3a39b to
218b998
Compare
|
@FlorianRappl Is there any docu regarding the branching strategy? What is |
|
Looks like the tests are flaky 😕 |
If I could change it I would make I wanted to reference the CONTRIBUTING.md, but - much to my surprise - found out we don't have one... Shame on me! Good point - that should be added (it will be similar to, e.g., https://github.com/AngleSharp/AngleSharp/blob/devel/.github/CONTRIBUTING.md) soon. Thanks for bringing this up @davidroth ! |
Some of the npm downloads did not go well (npm responded with a 503). This can (and realistically, unfortunately, will) always happen. No software is developed in a vacuum. Besides such errors (npm / package download not working) the runners are also not 100% reliable regarding execution of headless GUIs. So far the tests are rather stable in that region, but we have seen some issues in the past, too. |
Please give me a little bit more time |
softworkz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good! Thanks a lot for the contribution.
My suspicion is that this (503 gateway timeout) might happen due to protection at the side of npm which is limiting to many concurrent requests from the same source. For our tests, 14 action runners are working in parallel and - at least same OS types - may get to the moment doing 'npm install' more or less simultaneously. My PR #977 adds a random delay of 0-20 seconds - maybe this helps a bit... It also adds another "retry failed" workflow which does the same as when you manually go and click "re-run failed jobs" (but only once).
I had thought the same, but it has turned out that all these were about timing only. |
|
I'm not sure about the timing. If it would be rate limiting then 503 is the wrong status code. Also in a matrix test each run is performed on a different agent, so in general different IPs. If npm would go crazy because 15 machines install packages in parallel then we can shut down the JS ecosystem. |
Holding the connection and timing out after some time is a well-known technique for defeating attacks (leaving a tcp connection open to see how long the other party will hold on to it)
The runners are behind a NAT of course, they don't have all their own public IPs. |
|
But of course I'm not sure either wether the delay will be of any help... |
Sure not everyone has a dedicated IP but in general you will find multiple public IPs for the whole range of runners. So the likelihood of having at least 2 or 3 IPs when running on 15 different agents parallel is quite high I'd say (even though I am not sure how GitHub does that - for the Azure Pipelines agents this is true). While I agree on the holding the connection technique it is still not common to have a 503 here. It still would rather be a 504 or something else. Granting that npm went briefly down in the last couple of days (with 503 errors - I've seen those in some other pipelines that are not hosted on GitHub) I'd rather point the issue there. |
|
I have read somewhere that they have proxies for the DevOps runners to avoid downloading the same things a thousand times, and "gateway timeout" is a typical proxy error - which could masquerade the actual error from npm. But it could also be a problem with npm's CDN (also something where´"gateway timeout" can be seen). But well - it's all just speculation... |
Introduced a SetMenuItems method in Tray.cs to enable dynamic updates to the tray's context menu. This method clears the existing menu items, adds new ones, and registers the necessary click handlers.
Previously, updating menu item properties (such as changing the enabled state) required deleting and recreating the entire tray. Although this was functional, it caused noticeable flickering of the tray icon because the icon was briefly removed and then re-added.
With this change, the tray icon remains constant, and only the menu items themselves are replaced.
With the existing api
With the new api