diff --git a/crates/xmedia-bot/src/handlers/inline.rs b/crates/xmedia-bot/src/handlers/inline.rs index a705f80..a4775ef 100644 --- a/crates/xmedia-bot/src/handlers/inline.rs +++ b/crates/xmedia-bot/src/handlers/inline.rs @@ -135,8 +135,10 @@ pub async fn inline_query_handler(bot: Bot, query: InlineQuery) -> Result<(), Re } match answer_inline_query(bot, query).await { Ok(true) => {} - // No results produced (or nothing to answer): let a repeat of the - // same query retry the fetch. + // The fetch or the answer call failed: release so a repeat of the + // same query may retry it. An *empty* answer is a real answer + // (`Ok(true)`), so a link whose media Telegram cannot fetch is not + // re-fetched on every keystroke. Ok(false) | Err(_) => INLINE_DEBOUNCE_STATE.lock().release(user_id, &query_text), } }); @@ -233,6 +235,18 @@ async fn answer_inline_query(bot: Bot, query: InlineQuery) -> Result {} Err(e) => log::error!("inline fetch [key={}]: {e}", log_key(&query.query)),