Commit graph

192 commits

Author SHA1 Message Date
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
Paulo Castellano
9999335da6 feat: add Pinterest, Bluesky, Mastodon publish exceptions 2026-03-31 20:43:13 -03:00
Paulo Castellano
6587c76bc2 feat: add InstagramPublishException with 25 error codes 2026-03-31 20:37:52 -03:00
Paulo Castellano
c3c51d4ccd feat: add ErrorCategory enum and SocialPublishException base class 2026-03-31 20:34:41 -03:00
Paulo Castellano
5e5a15e796 docs: add image resize per platform implementation plan 2026-03-31 20:30:30 -03:00
Paulo Castellano
d081a118b9 docs: add social error mapping implementation plan 2026-03-31 20:23:11 -03:00
Paulo Castellano
cc94d65be8 docs: update image/video specs with verified official sources 2026-03-31 20:19:07 -03:00
Paulo Castellano
56ef30e14c docs: add image resize per platform design spec 2026-03-31 20:03:05 -03:00
Paulo Castellano
d23a9ce923 docs: add complete error codes for all 10 platforms from official docs 2026-03-31 19:59:33 -03:00
Paulo Castellano
7c0c8214f6 docs: update Instagram error codes from official Meta docs 2026-03-31 19:41:47 -03:00
Paulo Castellano
fdfa62ed9b docs: update error mapping spec to follow Laravel 13 conventions 2026-03-31 19:39:46 -03:00
Paulo Castellano
68cf8d9eaa docs: add social error mapping design spec 2026-03-31 19:34:34 -03:00
Paulo Castellano
9f3b8e547a fix: overhaul social publishing — validation, uploads, token refresh
- Fix UpdatePostRequest missing content_type, synced, meta fields
  (content_type was silently dropped, causing Instagram Reels to post as Feed)
- Create API FormRequests (StorePostRequest, UpdatePostRequest) replacing inline validation
- Fix syntax errors in all publishers ($media->isVideo() missing variable)
- Fix Instagram Feed with single video calling publishSingleImage instead of publishReel
- Fix TikTok hardcoded SELF_ONLY privacy — now queries creator_info API
- Refactor YouTubePublisher to use google/apiclient SDK with chunked resumable upload
- Fix all publishers using file_get_contents for large videos (memory overflow)
  — X, LinkedIn, LinkedInPage, Pinterest, Bluesky, Mastodon now use temp file + stream
- Fix Media::isVideo/isImage to use mime_type instead of extension
- Fix Threads not saving refresh_token (was null, now saves access_token)
- Add Instagram token refresh to publisher and ConnectionVerifier
- Fix PublishToSocialPlatform job: tries 3→1 (prevents duplicate uploads),
  timeout 60→600s, added failed() method for cleanup
- Increase Horizon worker timeout 60→630s, Redis retry_after 90→660s
- Increase upload limit 500MB→1GB
- Add mastodon to getDefaultContentType in Edit.vue
2026-03-31 19:25:19 -03:00
Paulo Castellano
bb6d0a2678 fix: Stripe webhook setup completion, notifications routing, billing UI
- Fix StripeEventListener: mark setup as Completed when subscription.created webhook fires
- Fix notifications routes: move outside subscribed middleware (non-critical feature)
- Fix NotificationBell: guard response.ok before parsing JSON
- Fix StripeEventListener: use data_get() for payload access
- Rewrite billing page to use SettingsLayout with download buttons on invoices
- Remove duplicate Unit/Listeners/StripeEventListenerTest (consolidated into Feature)
- Add comprehensive Stripe webhook tests (14 scenarios: happy path, setup transitions, edge cases, error handling)
- Update billing i18n: remove "no credit card" text, add status key
- Move auth layout logo to top-left corner
- Redesign onboarding Role page with compact list layout
- Add persona i18n translations (EN, PT-BR, ES)
- Update README with API, MCP, tech stack, quick start
2026-03-31 13:52:36 -03:00