Skip to content

Commit fcf2139

Browse files
v1.7.2: fix 2 bugs surfaced by v1.7.1 live test
Live testing on @longevityboris's Article (id 2056280764447113305) caught two real bugs in v1.7.1. 1. **`settings.disable_fxtwitter` opt-out was silently rejected.** The config struct had the field but the `config set` allowlist (`SETTABLE_KEYS`) and the `config get` matcher both missed it, so `xmaster config set settings.disable_fxtwitter true` returned a config_error and the flag was never written. Users who wanted strict v2-only behavior couldn't opt out. Fixed by adding the key to both surfaces. 2. **Bad tweet IDs to `xmaster analyze` silently analyzed the digit string as text** instead of erroring. When `parse_tweet_reference` matched a 19-digit string but the X API returned 400/404, the fallback `Err(_) => text.to_string()` swallowed the error and scored "9999..." as 19 chars of text. Now errors are propagated with the upstream API error message — users get a clear "tweet not found / bad ID" instead of a confusing fake-score. Verified: - `config set settings.disable_fxtwitter true` writes successfully; the next `xmaster read <article_id>` returns NO `article` field. - `config set settings.disable_fxtwitter false` re-enables and `article` reappears. - `xmaster analyze 9999999999999999999` errors cleanly with the X API's HTTP 400 message; `xmaster analyze 2056280764447113305` still scores the full Article body (45 / D, 6387 chars). 99 unit + 29 integration tests pass; clippy clean.
1 parent 049030e commit fcf2139

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "xmaster"
3-
version = "1.7.1"
3+
version = "1.7.2"
44
edition = "2021"
55
description = "Enterprise-grade X/Twitter CLI — post, reply, like, retweet, DM, search, and more"
66
license = "MIT"

src/commands/analyze.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,10 @@ pub async fn execute(
182182
// content. For Article wrappers (text = single t.co), enrich via
183183
// FxTwitter and analyze the Article body instead of the t.co link.
184184
// Friction-free: agents don't need a separate command to score a post.
185+
// If the input WAS a tweet reference but the fetch failed, surface the
186+
// error — don't silently analyze the ID digits as text.
185187
let resolved_text = if let Some(id) = parse_tweet_reference(text) {
186-
match resolve_post_content(&app, &id).await {
187-
Ok(content) => content,
188-
Err(_) => text.to_string(), // fall back to raw text on failure
189-
}
188+
resolve_post_content(&app, &id).await?
190189
} else {
191190
text.to_string()
192191
};

src/commands/config_cmd.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ pub async fn get(format: OutputFormat, key: &str) -> Result<(), XmasterError> {
234234
"account.premium" => cfg.account.premium.to_string(),
235235
"account.bio" => cfg.account.bio.clone(),
236236
"settings.timeout" => cfg.settings.timeout.to_string(),
237+
"settings.disable_fxtwitter" => cfg.settings.disable_fxtwitter.to_string(),
237238
"keys.xai" => mask(&cfg.keys.xai),
238239
"keys.api_key" => mask(&cfg.keys.api_key),
239240
"keys.api_secret" => mask(&cfg.keys.api_secret),
@@ -387,6 +388,7 @@ const VALID_CONFIG_KEYS: &[&str] = &[
387388
"keys.oauth2_access_token", "keys.oauth2_refresh_token",
388389
"keys.web_ct0", "keys.web_auth_token", "keys.graphql_create_tweet_id",
389390
"settings.timeout",
391+
"settings.disable_fxtwitter",
390392
"account.premium",
391393
"account.bio",
392394
"style.voice",

0 commit comments

Comments
 (0)