1353 Commits

Author SHA1 Message Date
Gilad Resisi
88eb6defbf fix(refresh): log a summary of the refresh error instead of the raw object
The raw error can carry the token request body (client secret, refresh
token) on providers whose refresh fails through the base fetch or a client
library. Log the message, HTTP status and the token endpoint's response
body instead, which is what makes the failure diagnosable.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 11:35:10 +07:00
Gilad Resisi
2dee7f0be0 fix(refresh): only the scheduled refresh tolerates unrecognized errors
Tolerating unrecognized refresh errors everywhere meant a dead token on a
provider without a handleErrors override was never flagged: the refresh
that follows a rejected post went through the same code and stayed silent.

The refresh service now takes a tolerateUnknownErrors flag, off by default.
The refreshToken activity turns it on only when the calling workflow is
refreshTokenWorkflow, read from the activity context, so post workflows of
every version (including the still-running v1.0.1 runs that share this
activity) keep disconnecting after a rejected post.

Also add 'disconnect' to the optional handleErrors interface type, which the
base class returns since this branch was opened.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 10:13:36 +07:00
Gilad Resisi
aefcccc43b Merge origin/main into fix/refresh-transient-errors 2026-09-23 09:30:37 +07:00
Gilad Resisi
ae1b80f340
Merge pull request #1827 from gitroomhq/fix/tag-deletion-cleanup
fix(tags): clean up post assignments on tag deletion and stop matching soft-deleted tags
2026-09-23 01:38:12 +00:00
Nevo David
b2548780b6 Merge remote-tracking branch 'origin/main' 2026-09-22 17:59:40 +07:00
Nevo David
dcb5b09e0e fix: allow mov 2026-09-22 17:58:20 +07:00
Gilad Resisi
c762ace600 Merge origin/main into fix/slack-reject-video 2026-09-22 17:14:32 +07:00
Gilad Resisi
04e60c8bfc
Merge pull request #2117 from gitroomhq/fix/slack-surface-post-errors
fix(slack): surface chat.postMessage failures instead of marking the post published
2026-09-22 07:11:13 +00:00
Gilad Resisi
b7e5037b96 Merge origin/main into fix/slack-reject-video 2026-09-22 13:58:54 +07:00
Gilad Resisi
89121c06a9 Merge origin/main into fix/slack-surface-post-errors 2026-09-22 13:58:34 +07:00
Gilad Resisi
e62ef360e0
Merge pull request #2116 from gitroomhq/feat/reddit-search-by-name
feat(reddit): resolve a pasted r/name or subreddit URL in the subreddit search
2026-09-22 06:55:39 +00:00
Gilad Resisi
df0dd91a9d feat(reddit): only offer public subreddits from the exact r/name lookup
Mirror the subreddit_type === 'public' filter of the search path so a
pasted r/name that points at a private, restricted or archived
subreddit is not offered as a destination the post would fail on.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 13:48:07 +07:00
Gilad Resisi
678acd4adc fix(slack): reject video attachments at save time
The Slack provider sends every attachment as a Block Kit image block,
which Slack only accepts for png / jpg / gif. An mp4 made
chat.postMessage reject the whole message, and the post was still
shown as published.

Add a checkValidity override so a Slack post or comment with an mp4
attachment fails validation with "No video support for Slack, only
images" in the composer, the public API and the MCP schedule tool.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 13:36:58 +07:00
Gilad Resisi
4e83569e56 fix(slack): surface chat.postMessage failures instead of marking the post published
Slack answers HTTP 200 with { ok: false, error } when it rejects a
message. post() and comment() destructured ts off that body and returned
status 'posted' regardless, so a rejected post (e.g. invalid_blocks for
an mp4 in an image block) was marked PUBLISHED with an empty release
URL and nothing in the channel.

Check the response after both chat.postMessage calls: auth errors throw
RefreshToken, ratelimited is retried, everything else throws BadBody
with Slack's error code and detail lines as the message.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 13:36:40 +07:00
Gilad Resisi
398b41e8a4 feat(reddit): resolve a pasted r/name or subreddit URL in the subreddit search
The composer's "Search Subreddit" box sent the typed text verbatim to
Reddit's subreddit search. A pasted reddit.com/r/<name> URL matched
nothing, so there was no result to pick and the subreddit setting was
saved empty, which then failed validation with "value should not be
null or undefined".

When the text contains r/<name>, search by the name alone and put the
exact subreddit first in the results if it exists. Plain text still
sends the same search request as before, and the exact lookup only
swallows a not-found response so token refresh keeps working.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 13:36:21 +07:00
Nevo David
4c835138aa fix: CVE-2026-94456 2026-09-22 11:52:20 +07:00
Gilad Resisi
9948b072e7 fix(facebook): request the reels metrics in video post analytics
A customer reported that their Facebook posts show no statistics at all;
every one of their Facebook posts is a reel. The video_insights edge
answers a reel with an empty data array for total_video_impressions,
total_video_views and total_video_reactions_by_type_total, so
videoPostAnalytics returned [] and the statistics modal stayed empty.

Verified against a real reel: the same request with fb_reels_total_plays,
post_video_likes_by_reaction_type and post_video_social_actions returns
values, and Graph simply omits whichever metrics do not apply to the
node, so both sets are now requested in one call. Regular videos keep
their existing cases; the new ones map to Plays, Reactions and
Engagement.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wvGQeFVP1UKfi9VAYYBYK
2026-09-22 10:36:56 +07:00
Gilad Resisi
9c594d2814
Merge pull request #2098 from gitroomhq/fix/facebook-analytics-swallowed-errors
fix(facebook): surface Graph API errors in page analytics instead of caching an empty result
2026-09-22 03:05:37 +00:00
Nevo David
08f0a68b78 Merge remote-tracking branch 'origin/main' 2026-09-21 14:04:33 +07:00
Nevo David
fc14ff16df feat: clipping 2026-09-21 14:03:40 +07:00
Gilad Resisi
0ffdbc9773 fix(hashnode): fail once when publishPost returns no post
A response without a post (data: null with no errors array, or a null
publishPost/post) threw a TypeError on destructuring, which is retried and
re-sends the publish mutation. Treat it as BadBody like the errors case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 12:53:18 +07:00
Gilad Resisi
12978bef19 fix(hashnode): move to the live GraphQL endpoint and current publishPost schema
Hashnode retired gql.hashnode.com on 2026-05-13: every request now gets a
301 to an announcement page, so connecting a channel failed with "Invalid
credentials" for every key, and publishing failed for existing channels.

- point the three calls (authenticate, publications, post) at
  gql-beta.hashnode.com
- send tags as { slug } (PublishPostTagInput no longer has id); the slug is
  looked up by objectID from the existing tags list, so stored posts keep
  working
- send the cover as coverImage (coverImageOptions was removed from
  PublishPostInput)
- read the GraphQL errors array and throw BadBody with Hashnode's message.
  Hashnode answers HTTP 200 with data: null for refusals such as a
  publication without an active Pro plan, which used to surface as a
  TypeError, get retried, and end as "couldn't confirm it was published"

Fixes #1737

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 12:44:46 +07:00
Gilad Resisi
ce6a7d2815
Merge pull request #2107 from gitroomhq/fix/gmb-release-search-url
fix(gmb): use Google's searchUrl as the post release URL
2026-09-21 05:22:49 +00:00
Enno Gelhaus
30be46ee5c
Merge pull request #2100 from gitroomhq/fix/sentry-skip-mcp-get-traces
fix(sentry): stop tracing GET requests to the MCP streamable routes
2026-09-21 04:37:59 +00:00
Enno Gelhaus
450f0b4486
fix(sentry): reduce tracesSampleRate to 0.1 for better performance 2026-09-21 06:35:36 +02:00
Gilad Resisi
6345ca5766 fix(gmb): use Google's searchUrl as the post release URL
The release URL for every Google My Business post was a hardcoded
https://business.google.com/locations/<locationId> link, which Google
answers with a 404, even for the logged-in profile owner. That link is
what the "published" notification email and the preview point to.

localPosts.create returns a searchUrl for the created post; use it as
the release URL and keep the old link only as a fallback when Google
does not send one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 08:47:49 +07:00
Nevo David
523aace1ba Merge remote-tracking branch 'origin/main' into feat/clipping-workflow 2026-09-19 15:18:41 +07:00
Nevo David
c7405ff9c8 fix(clipping): never give a draft claim back, draft one channel at a time
createPost writes one post per channel, so a failure on a later channel left
the earlier drafts in place while the released claim let a retry create them
again. The claim now stays, the free slot is looked up before it is taken, and
each channel is drafted on its own so one failing channel does not drop the rest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-19 14:39:38 +07:00
Nevo David
f5d83b19f6 fix(clipping): close the clip and draft creation races from review
- createClips takes the row of the clipping before looking for clips, so a
  timed out attempt and its retry can no longer both store a set
- a clip is claimed (draftedAt off null) before its draft is created and
  released when creation fails, so a retry cannot draft it twice
- urls are stripped from the logged processor failure
- Turkish billing label reads correctly after the number

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-19 14:22:48 +07:00
Nevo David
9aad99cde1 feat(clipping): YouTube video clipping workflow with REST, MCP tools and widget
Turns a YouTube video into captioned vertical clips that land in the media
library and as draft posts. Adds the Clipping / ClippingClip models, the
clipping_minutes credit type, clippingWorkflow + per-clip child workflows,
the /clipping REST routes, the MCP clipping tools and the ui://postiz/clipping
status widget.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-19 13:58:02 +07:00
Enno Gelhaus
9485ca502d
feat: add x-postiz-include-deleted header for the debug endpoints 2026-09-18 17:15:23 +02:00
Enno Gelhaus
01219ef9b0
Merge pull request #2096 from gitroomhq/feat/public-api-impersonate
feat: superuser public API endpoints
2026-09-18 14:28:13 +00:00
Nevo David
1251b5a0d1 feat: hovering and copy 2026-09-18 16:35:24 +07:00
Nevo David
c6bfe1355f feat: images preview 2026-09-18 16:17:04 +07:00
Nevo David
2c29ea3eeb feat(mcp): upload widget for uploading local files from Claude and ChatGPT
MCP has no way to send a file from the user's device, so add an MCP Apps
(SEP-1865) widget: uploadWidgetTool renders ui://postiz/upload, the widget
gets a short-lived ticket through the app-only uploadWidgetTicketTool and
posts the file to /media-widget/upload, then reports the media back to the
model. uploadWidgetStatusTool is the host-independent fallback.

The widget tools are mcpOnly, so the in-app agent keeps its current toolset.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 15:09:35 +07:00
Gilad Resisi
78f8a04b53 fix(sentry): stop tracing GET requests to the MCP streamable routes
The MCP server is stateless, so the GET that streamable-HTTP clients send
to open a server-to-client stream is not a supported route: nothing is
ever pushed on it. It is still about a quarter of MCP traffic (roughly
180k-214k of ~750k requests per day), and each one became a Sentry
transaction that stayed open for the life of the held connection
(avg ~5 min, p95 15 min).

Sentry usage is already near its limits, which is why #2082 recently cut
trace sampling from 100% to 20%. There is nothing to learn from traces of
an unsupported route, so tracesSampler now returns 0 for GET on /mcp,
/mcp/:id and the /mcp-oauth* mounts. POST traffic on the same routes, the
legacy /sse/:id transport and the /.well-known discovery routes keep the
existing sample rates.

Pairs with the change that answers these GETs with 405. Deploy this one
after that change has been verified in Sentry, because the verification
reads the GET transactions this commit removes.

Testing:
- Called the real tracesSampler with request contexts shaped like the
  http instrumentation passes them (method and URL via normalizedRequest
  and via span attributes only): GET on the MCP routes returns 0; POST on
  the same routes 0.2; unrelated GETs 0.2; analytics 0.01; legacy /sse
  0.2; /.well-known/.../mcp-oauth discovery 0.2; /mcpfoo 0.2.
- Ran the backend against a Sentry development environment and sent
  140+ GETs and 60+ POSTs to /mcp, /mcp/:id and /mcp-oauth-claude: zero
  GET transactions recorded, POST /mcp and POST /mcp/:id recorded as
  before. Same result on SDK 10.45.0 and 10.56.0.
- Backend type-check passes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 14:56:42 +07:00
Gilad Resisi
74ac26b8ec fix(facebook): surface Graph API errors in page analytics instead of caching an empty result
analytics() destructured only `data` from the page insights response, so any
Graph error body (rate limit, permission, invalid metric) silently became []
and checkAnalytics cached that empty result for an hour. Log the error and
throw, so checkAnalytics skips the cache write and the next call retries.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 14:02:33 +07:00
Nevo David
1207941bb9 revert(chat): drop the boot-time Mastra storage init
The mastra_* tables are now mirrored in schema.prisma, so prisma db push
creates them before the backend starts and the init race cannot happen.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 23:20:39 +07:00
Nevo David
e9245cad7d fix(prisma): mirror every Mastra 1.67 table and column in schema.prisma
prisma-db-push runs with --accept-data-loss on deploy, so anything Mastra
created that the schema did not mirror (37 tables, 31 columns) was dropped
and rebuilt by @mastra/pg on the next boot, which is where instances raced
on ALTER TABLE ADD COLUMN. The mastra_* models are now introspected from a
database migrated by @mastra/pg 1.25, so db push creates them before the
backend starts and Mastra's init finds nothing to alter. Existing mirrored
columns are unchanged; migrate diff against a migrated DB is empty.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 23:16:29 +07:00
Nevo David
6b40c6447c fix(chat): run the Mastra storage migration at boot with a retry
@mastra/pg checks for a column against a schema snapshot and then runs a
plain ALTER TABLE ADD COLUMN, so instances migrating at the same time race
and the loser throws 'column "organizationId" ... already exists' into the
first user request. Init now runs when the Mastra instance is created and
retries once against the already migrated schema.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 23:13:12 +07:00
Enno Gelhaus
aee9859725
fix: make channel health pick one deterministic top-level post per channel 2026-09-17 17:09:04 +02:00
Enno Gelhaus
82a10abd0f
fix: require every privileged member of an admin org to be a superuser 2026-09-17 16:49:54 +02:00
Enno Gelhaus
a1db9359ac
feat: add account overview debug endpoint for dispute evidence 2026-09-17 16:49:53 +02:00
Enno Gelhaus
b4da559750
fix: exclude oauth apps from superadmin surfaces and bound the channel health query 2026-09-17 16:49:53 +02:00
Enno Gelhaus
671b8eae0b
fix: report current channel counts alongside channels connected in range 2026-09-17 16:49:53 +02:00
Enno Gelhaus
facc77d8a1
feat: x-postiz-org override and support debug endpoints on the public API 2026-09-17 16:49:53 +02:00
Nevo David
48490b815d feat(mcp): serve the ChatGPT app on /mcp-oauth-chatgpt
OpenAI kept serving its cached copy of the /mcp-oauth authorization server
metadata, so the ChatGPT app submission moves to a fresh path with its own
issuer (no registration_endpoint, pre-defined client credentials).
/mcp-oauth stays available on the dynamic issuer for connectors that were
created against it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 01:51:10 +07:00
Nevo David
2a0d6885d3 feat(mcp): separate no-DCR issuer for /mcp-oauth, DCR issuer for the rest
The OpenAI Apps builder auto-selects DCR whenever the discovered
authorization server advertises a registration_endpoint. /mcp-oauth is the
ChatGPT app submission path and should default to the pre-defined client
credentials, so it now has its own RFC 8414 issuer without the registration
endpoint. /mcp-oauth-claude and /mcp-oauth-dynamic point at a second issuer,
/mcp-oauth-dynamic, that still advertises DCR for Claude, Cursor and other
self-registering clients. Both issuers share the same authorize, token and
userinfo endpoints; tokens are opaque so existing connections are unaffected.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 01:42:27 +07:00
Nevo David
f22d8c82d6 feat(oauth): accept client_secret_basic on the token endpoint
RFC 6749 搂2.3.1 requires the token endpoint to accept HTTP Basic client
authentication for clients that hold a secret. Until now only
client_secret_post worked, so a client sending the id and secret in the
Authorization header failed validation before the code was checked.

- extractBasicCredentials() next to extractBearerToken() decodes the header
- the token controller merges header credentials with the body
- registration mirrors back client_secret_basic when a client asks for it
- both discovery documents advertise client_secret_basic

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 01:03:03 +07:00
Nevo David
920da9ce56 fix(oauth): grant email claims to DCR clients on verified domains
The ChatGPT Apps builder registers its own client through DCR and, with
OIDC enabled, calls /oauth/userinfo after the token exchange. Only the
static OPENAI_OAUTH_CLIENT_ID app was allowed the openid/email scope and
a userinfo answer, so every builder client got a narrowed scope and a 403,
which ChatGPT reports as "Missing OAuth callback data".

allowsEmailClaims() keeps the static app and additionally trusts dynamic
clients whose https callbacks all sit on a DCR_VERIFIED_DOMAINS host.
Loopback-only / private-scheme clients and installs with an empty verified
list keep getting mcp scopes only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 00:16:48 +07:00