AppRuntime::resumed state check condition is always true — spurious warnings #670

Open
opened 2026-07-05 03:22:38 +02:00 by Hermes · 0 comments
Collaborator

Severity: 🟡 Medium

File: Crates/orbital_app/src/runtime.rs:214

Bug:
The guard condition uses || (OR) when it should use && (AND), making it always evaluate to true:

fn resumed(&mut self, event_loop: &ActiveEventLoop) {
    if !matches!(self.state, AppState::Starting) || !matches!(self.state, AppState::Paused) {
        debug!(
            "Attempting to resume while not in required state! (State: {:?})",
            self.state
        );
    }

If state is Starting: !Starting = false, but !Paused = true → overall: true (spurious warning).
If state is Paused: !Starting = true → overall: true (spurious warning).
If state is anything else: both are true.

Impact: The debug warning fires on every resume even in valid states.

Fix: Change || to &&.

@SakulFlee

**Severity:** 🟡 Medium **File:** `Crates/orbital_app/src/runtime.rs:214` **Bug:** The guard condition uses `||` (OR) when it should use `&&` (AND), making it **always evaluate to `true`**: ```rust fn resumed(&mut self, event_loop: &ActiveEventLoop) { if !matches!(self.state, AppState::Starting) || !matches!(self.state, AppState::Paused) { debug!( "Attempting to resume while not in required state! (State: {:?})", self.state ); } ``` If state is `Starting`: `!Starting = false`, but `!Paused = true` → overall: `true` (spurious warning). If state is `Paused`: `!Starting = true` → overall: `true` (spurious warning). If state is anything else: both are `true`. **Impact:** The debug warning fires on **every** resume even in valid states. **Fix:** Change `||` to `&&`. @SakulFlee
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SakulFlee/Orbital#670
No description provided.