Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

fix(tiktok): default disable_comment to true when meta omits allow_comments

Paulo Castellano65afd86824fe
diff --git a/app/Services/Social/TikTokPublisher.php b/app/Services/Social/TikTokPublisher.php
index d26a8a8a2..55d08c845 100644
--- a/app/Services/Social/TikTokPublisher.php
+++ b/app/Services/Social/TikTokPublisher.php
@@ -108,7 +108,7 @@ class TikTokPublisher
'title' => $content ?? '',
'privacy_level' => $this->resolveRequiredPrivacyLevel($postPlatform),
'disable_duet' => ! data_get($meta, 'allow_duet', false),
- 'disable_comment' => ! data_get($meta, 'allow_comments', true),
+ 'disable_comment' => ! data_get($meta, 'allow_comments', false),
'disable_stitch' => ! data_get($meta, 'allow_stitch', false),
];
@@ -142,7 +142,7 @@ class TikTokPublisher
$postInfo = [
'description' => $content ?? '',
'privacy_level' => $this->resolveRequiredPrivacyLevel($postPlatform),
- 'disable_comment' => ! data_get($meta, 'allow_comments', true),
+ 'disable_comment' => ! data_get($meta, 'allow_comments', false),
];
if (data_get($meta, 'brand_content_toggle', false)) {
diff --git a/tests/Feature/Services/Social/TikTokPublisherTest.php b/tests/Feature/Services/Social/TikTokPublisherTest.php
index a727ebed4..96016fa04 100644
--- a/tests/Feature/Services/Social/TikTokPublisherTest.php
+++ b/tests/Feature/Services/Social/TikTokPublisherTest.php
@@ -605,9 +605,10 @@ test('tiktok publisher uses default settings when only privacy_level is set', fu
$body = json_decode($request->body(), true);
$postInfo = data_get($body, 'post_info');
- // privacy_level passes through; toggles use safe defaults (duet/stitch off, comments on).
+ // privacy_level passes through; all interaction toggles default to OFF to match
+ // the UI checkbox state (TikTok UX guideline: none should be checked by default).
return $postInfo['privacy_level'] === 'PUBLIC_TO_EVERYONE'
- && $postInfo['disable_comment'] === false
+ && $postInfo['disable_comment'] === true
&& $postInfo['disable_duet'] === true
&& $postInfo['disable_stitch'] === true
&& ! isset($postInfo['is_aigc'])