fix(gui): replace tokio interval with gpui timer to prevent panic - #701
Open
clifinger wants to merge 1 commit into
Open
fix(gui): replace tokio interval with gpui timer to prevent panic#701clifinger wants to merge 1 commit into
clifinger wants to merge 1 commit into
Conversation
Greptile SummaryReplaces the Tokio interval in the desktop background loop with a GPUI executor timer, avoiding startup panic when the GUI runs without a Tokio reactor.
Confidence Score: 5/5The PR appears safe to merge, with the replacement timer remaining periodically re-armed on the GPUI executor. The GPUI timer task can be polled by the existing select loop, and every completed timer is unconditionally replaced before control returns to that loop.
|
| Filename | Overview |
|---|---|
| crates/openlogi-desktop/src/main.rs | Replaces the Tokio-dependent camera scan interval with a correctly re-armed GPUI timer; no actionable defect was identified. |
Reviews (1): Last reviewed commit: "fix(gui): replace tokio interval with gp..." | Re-trigger Greptile
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.
Summary
The recent commit
a2613f5684f4added atokio::time::intervalto the GUI's background loop, butopenlogi-desktopruns its async block on GPUI's executor (smol), not a Tokio reactor. This causes an immediate panic on startup:there is no reactor running, must be called from the context of a Tokio 1.x runtime.This PR replaces the Tokio interval with GPUI's native
cx.background_executor().timer(), which correctly yields on the GPUI executor.Changes
crates/openlogi-desktop/src/main.rs: swappedtokio::time::intervalforgpui::Timerto avoid Tokio dependency in the UI loop.Testing
Fixes # (no issue, observed locally)