{"record":{"id":"62a13a1c52891d27","repo":"tonhowtf/omniget","slug":"nenhuma-gravacao-ativa","errorCode":null,"errorMessage":"nenhuma gravacao ativa","messagePattern":"nenhuma gravacao ativa","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src-tauri/src/commands/tools/desktop.rs","lineNumber":107,"sourceCode":"                        serde_json::json!({ \"phase\": \"idle\", \"error\": e }),\n                    );\n                }\n            });\n        }\n        \"record\" => {\n            let app = app.clone();\n            tauri::async_runtime::spawn(async move {\n                let st = screen_record::state();\n                let r = if st.running && st.replay {\n                    screen_record::save_replay()\n                        .await\n                        .map(|p| serde_json::json!({ \"saved\": p }))\n                } else if st.running {\n                    screen_record::stop()\n                        .await\n                        .map(|s| serde_json::to_value(s).unwrap_or_default())\n                } else {\n                    Err(anyhow::anyhow!(\"nenhuma gravacao ativa\"))\n                };\n                let _ = app.emit(\n                    \"tool-record\",\n                    r.map_err(|e| e.to_string())\n                        .unwrap_or_else(|e| serde_json::json!({ \"error\": e })),\n                );\n            });\n        }\n        _ => {}\n    }\n}\n\n#[tauri::command]\npub fn tool_hotkeys_get() -> HashMap<String, String> {\n    tool_hotkeys()\n}\n\n/// Define (ou apaga, com `binding` vazio) o atalho de uma ação.","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/commands/tools/desktop.rs#L89-L125","documentation":"on_hotkey handles the record hotkey by branching on current screen-record state: if the tool is paused it resumes, if running it stops, and otherwise (neither paused nor running) it errors with 'nenhuma gravacao ativa' (Portuguese: 'no active recording'). The error is emitted to the frontend via the 'tool-record' event.","triggerScenarios":"Pressing the stop/toggle recording hotkey while no screen recording session is active: e.g. pressing the hotkey twice quickly (stop already processed), starting recording in another window/profile, or the recording process crashed/exited without updating the shared state so st.running is stale-false.","commonSituations":"User mashes the stop hotkey; desktop app restarted and hotkey state reset while the user believes recording is ongoing; a previous stop silently failed leaving state inconsistent.","solutions":["Ignore the error as expected behavior: only treat the hotkey as 'stop' when a recording is actually active; show a no-op/notification instead.","Check screen_record state before binding the hotkey action, or hide/disable the stop hotkey when no recording is running.","If state is stale (user is sure they were recording), restart the recording session — the recorder process likely died.","Localize/translate the Portuguese message if it surfaces in an English UI, and render it as a user-facing toast rather than an error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"listen('tool-record', (event) => {\n  const payload = event.payload;\n  if (payload && payload.error && payload.error.includes('nenhuma gravacao ativa')) {\n    showToast('No active recording'); // expected no-op, not a real failure\n  }\n});","preventionTips":["Treat this as expected flow — pressing stop with no recording is a no-op","Disable the stop hotkey/action while no recording is active","Synchronize recording state across windows so stale UI doesn't trigger it","Translate the Portuguese message for non-Portuguese locales"],"tags":["desktop","screen-recording","hotkey","invalid-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}