trypost/lang/en
Paulo Castellano 620d23187e fix(social): handle TokenExpired status fail-fast and notify user
Three related fixes for the failure mode where a scheduled post errors out
as 'An unknown X error occurred.' when a social account's refresh_token
was already invalidated by the provider:

1. **PublishToSocialPlatform**: fail-fast when account status is
   `TokenExpired`. Previously the job tried to publish, the publisher
   internally tried to refresh, the provider rejected the rotated
   refresh_token, and the failure surfaced as a generic 'unknown' error
   instead of a clear 'reconnect your account' signal.

2. **XPublisher::refreshToken**: when the OAuth endpoint rejects the
   refresh_token (typically because it was rotated/revoked at X), log the
   raw response and throw `TokenExpiredException` instead of falling
   through to `XPublishException::fromApiResponse` which expects the
   tweet-API response shape (`type`/`title`/`detail`) and treats
   OAuth-style responses (`error`/`error_description`) as 'Unknown'.

3. **SocialAccount::markAsTokenExpired**: dispatch an in-app + email
   notification (`Type::AccountDisconnected`) when an account
   transitions from `Connected` → `TokenExpired`, mirroring the
   existing pattern in `markAsDisconnected`. Wrapped in a lock to
   prevent duplicate notifications on concurrent transitions. Accepts an
   optional `notify: false` so the batch verifier
   (`VerifyWorkspaceConnections`) can suppress per-account
   notifications and rely on its summary email.
2026-05-12 18:46:06 -03:00
..
accounts.php feat: localize OAuth popup callback messages across 12 controllers 2026-05-07 14:03:52 -03:00
analytics.php refactor: localize analytics metrics and overhaul UI components and dashboard layouts 2026-05-06 15:39:10 -03:00
assets.php feat: media gallery picker, custom emoji picker, preview tabs, real platform logos 2026-05-01 14:53:49 -03:00
auth.php feat: capture signup UTMs/IP and add GitHub OAuth login 2026-05-04 18:42:25 -03:00
billing.php refactor: redesign billing settings + upgrade dialog with indies aesthetic 2026-05-06 17:00:25 -03:00
brands.php feat: add brands frontend (sidebar, index page, create/edit dialogs, translations) 2026-04-14 19:22:33 -03:00
calendar.php feat: add daily view to calendar for mobile 2026-01-26 18:03:35 -03:00
comments.php refactor: standardize UI components, modernize localization structure, and remove legacy appearance management middleware. 2026-05-06 14:26:18 -03:00
common.php feat: lightbox supports navigation, video, and click-outside-to-close 2026-05-08 19:16:38 -03:00
labels.php refactor: standardize UI components, modernize localization structure, and remove legacy appearance management middleware. 2026-05-06 14:26:18 -03:00
mail.php feat: @mentions in comments, AI Action layer + MCP tools, settings tabs 2026-05-01 20:59:03 -03:00
notifications.php refactor: introduce VideoPreview component and standardize media handling across post previews 2026-05-08 18:30:11 -03:00
pagination.php feat: improvements on ui 2026-01-21 17:57:15 -03:00
passwords.php feat: improvements on ui 2026-01-21 17:57:15 -03:00
posts.php fix(social): handle TokenExpired status fail-fast and notify user 2026-05-12 18:46:06 -03:00
settings.php feat: AI image generation pipeline and post creation overhaul 2026-05-08 13:38:30 -03:00
sidebar.php feat: implement settings hub dashboard and update usage metrics to support unlimited plans 2026-05-03 15:54:26 -03:00
signatures.php refactor: standardize UI components, modernize localization structure, and remove legacy appearance management middleware. 2026-05-06 14:26:18 -03:00
usage.php feat: transition AI usage from feature-based limits to a centralized monthly credit system with token tracking. 2026-05-03 19:36:26 -03:00
validation.php feat: improvements on ui 2026-01-21 17:57:15 -03:00
workspaces.php feat: implement workspace management and update localization strings across multiple languages 2026-05-06 16:41:27 -03:00