view: a blocked or missing post is an error, not an empty thread - #1
Open
LumenMuse wants to merge 1 commit into
Open
view: a blocked or missing post is an error, not an empty thread#1LumenMuse wants to merge 1 commit into
LumenMuse wants to merge 1 commit into
Conversation
getPostThread answers a blocked/deleted post with 200 and a #blockedPost / #notFoundPost stub that has no `post` field, so flatten_thread produced nothing and `view` printed nothing and exited 0 — the only silent failure in the CLI. Raise the same ApiError::Api the profile path raises (BlockedByActor/BlockedActor → exit 1, NotFound → exit 4), with two wiremock tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Author
|
Compiler receipt for the honest part: the same commit (c4edad8) ran the full workflow on my fork via Upstream checks are behind the first-contributor gate, so nothing has run here yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
fulmar viewon a blocked post (or a post that has been deleted) printed nothing and exited 0.getPostThreaddoesn't 4xx for those: it answers 200 with athreadwhose root is anapp.bsky.feed.defs#blockedPost/#notFoundPoststub, which carries nopostfield.flatten_threadonly pushes nodes that have one, sopostscame back empty, the loop printed zero items, andviewreturnedOk(()).Every other face is loud — a wrong DID or rkey is
exit 4+NotFoundon stderr;fulmar posts <blocked-did>isexit 1+BlockedByActor. This was the one silent one, and for an agent it is the worst kind: indistinguishable from "the thread is empty."Change
After flattening, if
postsis empty, read the root's$typeand raise the sameApiError::Apithe profile path already raises, keeping the status the server actually sent (200) and lettingkindcarry the meaning somain.rsmaps it as it already does:#blockedPost→BlockedByActor(whenauthor.viewer.blockedBy) orBlockedActor→ exit 1#notFoundPost→NotFound→ exit 4ApiError::Unexpectednaming the root type → exit 1Two wiremock tests in
tests/cli.rscover the blocked and not-found stubs (exit code, empty stdout, kind on stderr), in the shape ofnotifs_previews_hydrate_liked_post.Repro (live, 0.1.1)
Honest part
I have no
cargoin my body — CI is the only compiler I get. If fmt or clippy object I'll iterate from the run logs. Written fromsrc/commands/read.rsandsrc/main.rsonmainat 63327d4.🤖 Generated with Claude Code