Skip to content

fix(tiktok): default content_posting_method to DIRECT_POST#1687

Open
giladresisi wants to merge 1 commit into
mainfrom
fix/tiktok-upload-method-default
Open

fix(tiktok): default content_posting_method to DIRECT_POST#1687
giladresisi wants to merge 1 commit into
mainfrom
fix/tiktok-upload-method-default

Conversation

@giladresisi

Copy link
Copy Markdown
Collaborator

Problem

Scheduled TikTok posts were being marked successful in Postiz and Temporal but never published. The postSocial activity returned postId: "missing" with a tiktok.com/messages release URL.

Root cause: the post had content_posting_method: "UPLOAD" instead of DIRECT_POST. UPLOAD does not publish — TikTok's API delivers the video to the account's app inbox, where the user must manually complete it within ~24h or it's discarded. This is TikTok's SEND_TO_USER_INBOX terminal status, which we (correctly) treat as a successful upload.

Why the agent chose UPLOAD: the chat/MCP agent had to supply content_posting_method with no guidance — it's a bare required enum ('DIRECT_POST' | 'UPLOAD') with no description or default, and TikTok's agent @Rules said nothing about it. For a video post, "UPLOAD" reads like the obvious choice. The user never asked for it; the model guessed.

Fix (two layers)

  • @Rules guidance (tiktok.provider.ts): the agent is now told to use DIRECT_POST unless the user explicitly asks to review/edit inside the TikTok app first, and that UPLOAD does not publish.
  • Hard default (integration.schedule.post.ts): a PROVIDER_SETTINGS_DEFAULTS map + buildSettings() helper fills content_posting_method with DIRECT_POST when the key is omitted — applied in both the validation and creation paths — so an omitted value can never land on UPLOAD by accident. The default map is TikTok-only; all other providers reduce to the exact prior behavior.

Testing

  • Validated live over MCP: scheduling a TikTok draft omitting content_posting_method now yields DIRECT_POST.
  • Behavior-preserving for non-TikTok providers (defaults map has only a tiktok entry).
  • Typechecks (backend).

Notes

First of two related changes. A follow-up feature branch (agent list/update of scheduled posts) stacks on this one and will be opened as a separate PR.

🤖 Generated with Claude Code

The agent (chat / MCP) had to pick content_posting_method with no
guidance: the setting is a bare required enum with no description or
default, and TikTok's agent rules said nothing about it. For a video
post "UPLOAD" reads like the obvious choice - but UPLOAD does not
publish, it only drops the video into the user's TikTok app inbox,
where it must be completed manually within ~24h or it is discarded.
Users hit this as "post marked successful but never published".

Two layers:
- TikTok @rules text now tells the agent to use DIRECT_POST unless the
  user explicitly asks to review/edit in the app first, and explains
  that UPLOAD does not publish.
- A PROVIDER_SETTINGS_DEFAULTS map + buildSettings() helper fills
  content_posting_method with DIRECT_POST when the key is omitted, in
  both validation and creation, so an omitted value can never land on
  UPLOAD by accident.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@postiz-contribution postiz-contribution Bot added the contribution:approved Approved contributor label Jul 8, 2026
@postiz-contribution

Copy link
Copy Markdown

Contribution-checker quality warning
Heuristic score: 1/100 (low). This is a non-blocking warning surfaced by the project's quality settings.

Heuristics that flagged:

  • Excessive inline code references: 24 inline refs (>3)
  • PR doesn't use the repo's PR template: 5 required checkbox items missing (max 1, match ≥80%)
  • Body adds too many extra headers beyond the template: 4 extra headers (>1)
  • AI watermark phrase: Matched: "Generated with Claude Code"
  • Commit message too long: Longest: 1011 chars

If this is a genuine contribution, please add detail to your PR description and tighten the diff scope before reviewers look at it.

@postiz-agent

postiz-agent Bot commented Jul 8, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution:approved Approved contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant