summaryrefslogtreecommitdiffstats
path: root/firefly_cli/resolver.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-02 09:21:27 +0200
committerDanilo M. <danix@danix.xyz>2026-07-02 09:21:27 +0200
commit71658d023fdbf60be6b4501372519bf8171d6e13 (patch)
treebf9adcd6bfd60b56303dad219dfe79b003fe0818 /firefly_cli/resolver.py
parent166f82d0bfdc598099c088275d68dc42499694f9 (diff)
downloadfirefly-cli-71658d023fdbf60be6b4501372519bf8171d6e13.tar.gz
firefly-cli-71658d023fdbf60be6b4501372519bf8171d6e13.zip
fix: register cmd_add handler correctly for tx add (v0.3.8)HEADv0.3.8master
v0.3.7 placed the @registry.command decorator above a helper (_resolve_side) inserted between the decorator and cmd_add, so the registry bound the helper as the "tx add" handler. Unit tests call cmd_add directly and missed it; live CLI dispatch failed with "_resolve_side() missing 2 required positional arguments". Move the helper above the decorator and add a regression test asserting the registered handler is cmd_add. Found by live smoke test against the test instance. Also note in resolver that Firefly returns 401 (not 404) for an unknown account id. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'firefly_cli/resolver.py')
-rw-r--r--firefly_cli/resolver.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/firefly_cli/resolver.py b/firefly_cli/resolver.py
index 2a73e79..7296aad 100644
--- a/firefly_cli/resolver.py
+++ b/firefly_cli/resolver.py
@@ -30,7 +30,10 @@ class Resolver:
def account_by_id(self, acc_id):
# Escape hatch for same-name accounts (ISSUES.md #2): GET the account
- # directly; a bad id 404s and client.request surfaces a FireflyError.
+ # directly; a bad id errors and client.request surfaces a FireflyError.
+ # ponytail: Firefly returns 401 (not 404) for an unknown account id, so
+ # the message reads "Unauthenticated"; the write is still blocked, which
+ # is what matters. Remap to "account not found" only if it confuses users.
item = self.client.request("GET", f"/api/v1/accounts/{acc_id}")["data"]
return {"id": item["id"], **item.get("attributes", {})}