feat: create/publish posts & replies + upsert hardening - #3
Merged
Conversation
Integrate Post::merge into upsert_post_tx so that re-upserting a sparse reply-edge version of an existing post (identifiable by a @username sentinel author) never overwrites richer stored fields (text, created_at, permalink, media, urls, mentions, is_quote_post, real author id).
…ublishing_limit objects
…rStatus, PublishingLimits
…ublishing_limits/fetch_post + carousel methods to Provider trait
…Resp, PublishingLimitResp DTOs
…ner_status, publishing_limits, fetch_post
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.
Summary
Post::merge, integrated intoupsert_post_txgated on the@usernamesentinel so a sparse reply-edge re-fetch can't clobber richer stored data, while full (numeric-author) fetches still overwrite.dto_to_postnow synthesizes the@usernamesentinel; ingest persists themeprofile and runsresolve_authorto rewrite@handleposts to the real numeric id (fixes the engagement-seed miss).threads-cli post createcommand publishing text/image/video/carousel posts and replies via the official two-step flow (create container → poll status for media → publish), with remote quota preflight (250 posts / 1000 replies viathreads_publishing_limit), a confirm-then-publish gate, and after-publish upsert into the local store. AddsHttpClient::post_json, 7Providermethods, response DTOs, manifest actions/objects, and thethreads_content_publishscope. Carousel uses type-safecreate_carousel_item/create_carousel_container(no magic-string sentinels).docs/superpowers/.Test Plan
cargo test --workspace— 164/164 passcargo clippy --workspace --all-targets -- -D warnings— cleanthreads-cli auth login(acquirethreads_content_publish), thenthreads-cli post create --text "hello" --yes→ verify it posts and is stored locally (threads-cli show <id>)threads-cli post create --reply-to <own-post-id> --text "reply"→ verify the reply--image-url <public-https>single + carousel (≥2)Notes
threads_keyword_search/threads_manage_mentions(surfaced as a non-blocking warning).is_terminalinto the confirm gate for testability; thin tests for poll error-states / stdin;synthesize_post.root_idis approximate for nested replies on the fetch-failure fallback.