fix(gui-client): don't busy-loop when update checker is disabled - #9445
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR prevents a busy-loop when the update checker is disabled by flattening the nested Option for update notifications and reprioritizing channels so new-instance deep-links are still handled.
- Simplified
UpdateNotificationvariant fromOption<Option<...>>toOption<...> - Changed the event-loop from
while let Some(...)to an infiniteloopwith amatchon a non-optional tick - Reordered
ticksoNewInstanceLaunchedis polled before update notifications
Comments suppressed due to low confidence (3)
rust/gui-client/src-tauri/src/controller.rs:396
- [nitpick] Consider adding a comment here explaining that update notifications are intentionally deprioritized and that closing the updates channel should not cause a busy-loop.
if let Poll::Ready(Some(notification)) = self.updates_rx.poll_next_unpin(cx) {
rust/gui-client/src-tauri/src/controller.rs:297
- Add a test case simulating the update-checker being disabled (updates_rx channel closed) to verify that the controller does not busy-loop and still processes deep-link events.
loop {
rust/gui-client/src-tauri/src/controller.rs:340
- [nitpick] The name
notificationhere represents anOption<updates::Notification>. For clarity, consider renaming it tomaybe_notificationornotification_opt.
EventloopTick::UpdateNotification(notification) => {
thomaseizinger
enabled auto-merge
June 6, 2025 08:55
jamilbk
approved these changes
Jun 6, 2025
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jun 7, 2025
This timeout seems to be problematic as deep-links don't open with it at all. This is a regression from #9445.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GUI client's update checker is a task that runs concurrently to the main event-loop of the client. When a new update is found, it sends a notification through a channel. When the update checker is disabled via MDM, this channel is instantly closed, resulting in
Nonebeing read as part of the event-loop in the client.Previously, we would then return
Poll::Ready(EventloopTick::UpdateNotification(None))and then simply ignore this event. This however is wrong. ReturningPoll::Readymeans that the future needs to be polled again, resulting in an effective busy-loop where we constantly emit the above event and then ignore it. Due to the priority order that was previously defined, this led to us never checking another channel: The one where we receive deep-links from 2nd GUI instances.As a result, signing into the client when the update checker was disabled does not work and instead, the newly launched instance hangs because it can never send over the deep-link.
Resolves: #9420