Commit graph

205 commits

Author SHA1 Message Date
Paulo Castellano
557507672e fix: keep Google OAuth routes always registered and add tests
Routes must always exist so Wayfinder can generate TypeScript helpers.
The toggle now only controls frontend visibility via Inertia prop.
2026-04-14 14:28:17 -03:00
Paulo Castellano
d94374c31a refactor: remove TRYPOST_ prefix from platform env variables
Standardizes env naming to match existing convention (THREADS_CLIENT_ID,
GOOGLE_AUTH_ENABLED, etc).
2026-04-14 14:19:51 -03:00
Paulo Castellano
25c43a3906 refactor: rename TRYPOST_GOOGLE_AUTH_ENABLED to GOOGLE_AUTH_ENABLED
Aligns with existing Google env naming convention (GOOGLE_AUTH_CALLBACK).
2026-04-14 14:16:34 -03:00
Paulo Castellano
57df5d5253 feat: add TRYPOST_GOOGLE_AUTH_ENABLED toggle to show/hide Google login on auth pages 2026-04-01 15:27:26 -03:00
Paulo Castellano
6e86b83433
Merge pull request #10 from trypost-it/refactor/actions-subdomain-routes
refactor: single-domain routing, actions, policies, Google login, PostHog, full test coverage
2026-04-01 15:20:51 -03:00
Paulo Castellano
5e3520eadd chore: remove stale lang json files 2026-04-01 15:20:34 -03:00
Paulo Castellano
66d0731090 fix: YouTube requires content text — frontend validation now shows error when content is empty 2026-04-01 15:12:56 -03:00
Paulo Castellano
7aaaf4df4f fix: revert Facebook Reel/Story to URL pull (video_file_chunk as URL) — binary upload was breaking the transfer phase 2026-04-01 15:07:02 -03:00
Paulo Castellano
146bd7b7d2 fix: delete post redirects to posts index instead of back() which causes 404 2026-04-01 15:04:13 -03:00
Paulo Castellano
4e6a2dace1 fix: increase OAuth callback close delay to 5s 2026-04-01 14:55:45 -03:00
Paulo Castellano
da2b7ca9ca fix: Facebook/Instagram/Threads OAuthException type incorrectly treated as token error — now only code 190 triggers TokenExpiredException 2026-04-01 14:33:26 -03:00
Paulo Castellano
fbe49e917f refactor: use Status enum instead of hardcoded string in scheduled_at validation 2026-04-01 14:29:03 -03:00
Paulo Castellano
09533b0f84 fix: scheduled_at after:now only for 'scheduled' status, not 'publishing' (publish now) 2026-04-01 14:28:24 -03:00
Paulo Castellano
0bca140cd9 fix: API scheduled_at validation, redirect allowlist, UUID model_id, UpdatePost transaction, safe resolveModel 2026-04-01 13:21:22 -03:00
Paulo Castellano
d19a5c7bcf fix: RecoverStuckPosts also recovers platforms stuck in Pending status 2026-04-01 13:12:55 -03:00
Paulo Castellano
5e1f9eaa82 refactor: move duplicate validation to DuplicateMediaRequest FormRequest 2026-04-01 13:01:07 -03:00
Paulo Castellano
29bc7deb21 fix: restrict status to user-settable values, validate duplicate targets, scope API labels 2026-04-01 12:57:43 -03:00
Paulo Castellano
c0afd38a0e fix: chunk identifier includes user ID to prevent cross-user collision, API label_ids scoped to workspace 2026-04-01 12:52:49 -03:00
Paulo Castellano
a9184c9401 fix: withoutOverlapping on schedules, publisher token refresh lock, PublishPost tries:1, TokenExpired allows publish, API validation scoping 2026-04-01 12:49:01 -03:00
Paulo Castellano
9d0a860d87 fix: prevent double-publish race condition, media upload auth bypass, TokenExpired disconnected_at 2026-04-01 12:34:38 -03:00
Paulo Castellano
f3c7a3bc13 fix: scheduled_at after:now validation, Facebook token not exposed to frontend, duplicate notifications, chunked mime validation 2026-04-01 12:19:24 -03:00
Paulo Castellano
08704421a2 docs: add social platform API references to CLAUDE.md with official doc links 2026-04-01 12:08:36 -03:00
Paulo Castellano
57ad4e2c7f fix: Mastodon preserves safe HTML (strong, em, a, p, br) instead of stripping everything 2026-04-01 12:05:22 -03:00
Paulo Castellano
a1df51234b fix: review #5 — ContentSanitizer in all publishers, refresh lock, CheckSocialConnections includes TokenExpired 2026-04-01 12:02:15 -03:00
Paulo Castellano
a69dc28298 fix: VerifyWorkspaceConnections uses TokenExpired/Disconnected escalation, eager load workspace 2026-04-01 11:52:03 -03:00
Paulo Castellano
8ca846a865 feat: use TokenExpired state instead of Disconnected on first token failure 2026-04-01 11:46:51 -03:00
Paulo Castellano
e034c0b572 feat: publishing hardening — content sanitization, validation, scopes, stuck recovery
- Add ContentSanitizer: strips HTML, converts bold/underline to Unicode for LinkedIn
- Add backend content length validation in all 11 publishers via HasSocialHttpClient trait
- Add scope verification before publishing — checks required scopes per platform
- Add RecoverStuckPosts command (every 30min) — recovers posts stuck in publishing > 1h
- Add requiredPublishScopes() to Platform enum
- Update SocialAccount factory with correct scopes per platform state
2026-04-01 11:25:25 -03:00
Paulo Castellano
8cbc372d91 test: add error_context verification tests for all failure scenarios 2026-04-01 11:09:26 -03:00
Paulo Castellano
8e33f9ce4f feat: add error_context column to post_platforms for structured error debugging 2026-04-01 11:07:21 -03:00
Paulo Castellano
5903f0d894 docs: add publishing hardening spec (6 improvements from Postiz comparison) 2026-04-01 10:59:08 -03:00
Paulo Castellano
c48c774e23 feat: publishing engine improvements — rate limit retry, inline token refresh, per-platform queues, proactive refresh
- Add HasSocialHttpClient trait with 429 rate limit retry (3 attempts, 5s delay)
- Integrate trait into all 10 publishers (YouTube uses Google SDK)
- Add inline token refresh retry in PublishToSocialPlatform job
- Add per-platform Horizon queues via Platform::queue() and Platform::allQueues()
- Add RefreshExpiringTokens hourly command for proactive token refresh
- Fix token leaks: redact response bodies in all Log::error calls
- Fix token leaks: remove $response->body() from exception messages
- Fix ConnectionVerifier: redact all refresh error logs
- Fix null checks on API response IDs (Instagram, Threads, Pinterest, Facebook)
- Fix PublishPost::failed() to mark post as failed
- Fix StoreChunkedMediaRequest: validate max 1GB total size
- Fix scheduled_at validation: string → date
- Fix StoreMediaRequest: images max 10MB, videos max 1GB, only MP4 video
2026-04-01 10:51:53 -03:00
Paulo Castellano
6a26707dc8 docs: add publishing engine improvements plan (tasks 1-4 now, 5-6 future) 2026-04-01 09:49:09 -03:00
Paulo Castellano
33cbc57b59 docs: add publishing engine improvements spec (Postiz comparison) 2026-04-01 09:43:15 -03:00
Paulo Castellano
cebaaaf60b test: add comprehensive publisher tests for all media flows and edge cases 2026-04-01 09:32:43 -03:00
Paulo Castellano
ce46a4d984 fix: close Facebook streams, check download responses, X stream upload 2026-04-01 08:59:47 -03:00
Paulo Castellano
45dd3f4bde fix: file handle leaks, return types, Facebook reel/story binary upload, null checks, cleanup 2026-03-31 22:41:26 -03:00
Paulo Castellano
e90a24fc31 fix: Pinterest video try/finally, LinkedIn/Mastodon stream uploads, close file handles 2026-03-31 22:18:05 -03:00
Paulo Castellano
307b496bad fix: separate image/video upload limits (10MB/1GB), accept only MP4 video 2026-03-31 22:13:04 -03:00
Paulo Castellano
0cf84e4424 chore: remove verbose Log::info, add GD memory check, redact tokens in exception context 2026-03-31 22:04:12 -03:00
Paulo Castellano
6e3dac7a66 fix: GD memory safety check and redact tokens from exception context 2026-03-31 22:01:59 -03:00
Paulo Castellano
2883793441 chore: remove verbose Log::info from all publishers 2026-03-31 22:01:14 -03:00
Paulo Castellano
aa6bc88335 fix: code review issues — Instagram arg count, LinkedIn file handle, TikTok data_get, YouTube token timestamp 2026-03-31 21:46:58 -03:00
Paulo Castellano
6c2a354594 refactor: remove unused context param from handleApiError across all publishers 2026-03-31 21:43:30 -03:00
Paulo Castellano
30bfb2a890 refactor: use data_get in MediaOptimizer for consistency 2026-03-31 21:25:37 -03:00
Paulo Castellano
4ddb4d941a feat: integrate MediaOptimizer into all image-uploading publishers 2026-03-31 21:22:57 -03:00
Paulo Castellano
02298f31a6 refactor: all remaining publishers use platform-specific exceptions 2026-03-31 21:04:39 -03:00
Paulo Castellano
2320c9ae63 refactor: TikTok, YouTube, Facebook publishers use platform exceptions 2026-03-31 20:52:32 -03:00
Paulo Castellano
21cd95d512 refactor: InstagramPublisher uses InstagramPublishException 2026-03-31 20:47:05 -03:00
Paulo Castellano
6886767f9a feat: PublishToSocialPlatform catches SocialPublishException 2026-03-31 20:45:41 -03:00
Paulo Castellano
92ef7428b1 feat: add LinkedIn, X, Threads publish exceptions 2026-03-31 20:43:21 -03:00