Skip to content

Commit 4f469c7

Browse files
committed
fix(providers): wire the LinkedIn and Moltbook settings DTOs
validatePosts runs settings-DTO validation only when the provider declares `dto`. LinkedinProvider and MoltbookProvider never did, so for linkedin, linkedin-page (inherits from LinkedinProvider) and moltbook that validation layer silently did not run: LinkedinDto and MoltbookDto existed but were unwired, and any malformed or missing settings value was accepted and stored. The dashboard never hits this (its form validates client-side with the same DTO classes), but the public API (POST /public/v1/posts, PUT /public/v1/posts/:id/settings) and the agent/MCP tools share validatePosts and were unprotected - an API caller's typo or an LLM-guessed settings value was accepted with a 200. The cost surfaced later instead: a moltbook post without submolt silently publishes to the "general" community (provider falls back to it), and a truthy non-boolean carousel value on LinkedIn fails at publish time on a post the user was told was valid. Declare `dto = LinkedinDto` on LinkedinProvider (LinkedinPageProvider inherits it) and `dto = MoltbookDto` on MoltbookProvider, so bad values are rejected at save time with a specific message (400 / {errors}). Audited all providers: these were the only unwired settings DTOs.
1 parent 013db1d commit 4f469c7

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

libraries/nestjs-libraries/src/integrations/social/linkedin.provider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ type LinkedinPendingData = {
5858
export class LinkedinProvider extends SocialAbstract implements SocialProvider {
5959
identifier = 'linkedin';
6060
name = 'LinkedIn';
61+
dto = LinkedinDto;
6162
oneTimeToken = true;
6263

6364
isBetweenSteps = false;

libraries/nestjs-libraries/src/integrations/social/moltbook.provider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '@gitroom/nestjs-libraries/integrations/social/social.integrations.interface';
77
import { makeId } from '@gitroom/nestjs-libraries/services/make.is';
88
import { SocialAbstract } from '@gitroom/nestjs-libraries/integrations/social.abstract';
9+
import { MoltbookDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/moltbook.dto';
910
import dayjs from 'dayjs';
1011
import { Integration } from '@prisma/client';
1112

@@ -15,6 +16,7 @@ export class MoltbookProvider extends SocialAbstract implements SocialProvider {
1516
override maxConcurrentJob = 100; // Moltbook: 100 requests/minute
1617
identifier = 'moltbook';
1718
name = 'Moltbook';
19+
dto = MoltbookDto;
1820
isBetweenSteps = false;
1921
scopes = [] as string[];
2022
isWeb3 = true;

0 commit comments

Comments
 (0)