Skip to content

Marcus finishes x auto poster#2150

Open
marcusyi1 wants to merge 25 commits intodevelopmentfrom
Marcus-finishes-x-auto-poster
Open

Marcus finishes x auto poster#2150
marcusyi1 wants to merge 25 commits intodevelopmentfrom
Marcus-finishes-x-auto-poster

Conversation

@marcusyi1
Copy link
Copy Markdown
Contributor

Description

Implements the X (Twitter) manual-assist posting flow for the social media autoposter. This replaces the previous auto-posting approach (which called the X API directly) with a manual-assist pattern modeled after Truth Social — the app composes, schedules, and stages posts, but the user manually posts to X via a "Copy & Post" workflow.

Related PRS (if any):

This backend PR is related to the #5101 frontend PR (Marcus-implements-x-autopost-fe).

Main changes explained:

  • Rewrite src/controllers/xPostController.js — removed all X API calling code (Bearer token auth, postToX(), getBearerToken(), authHeader()). createPost now saves a local DB record and returns an intentUrl for manual posting. getHistory now queries the local DB instead of the live X API. Added three new handlers: markAsPosted, updateScheduledPost, skipPost.
  • Rewrite src/cronjobs/xScheduleJob.js — simplified from 85 lines to 25 lines. Removed uploadMedia(), processScheduledPost(), all X API calls. The cron now only flips status: 'pending' → status: 'ready' via updateMany when scheduledAt has passed. No deletion, no API calls.
  • Update src/models/xScheduledPost.js — added status field (enum: pending/ready/posted/skipped), postedAt, altText, and a DB index on scheduledAt. Records now persist with status updates instead of being deleted after processing.
  • Update src/routes/xRouter.js — added three new routes: PUT /schedule/:id (edit), PATCH /schedule/:id/mark-posted, PATCH /schedule/:id/skip.
  • Update src/startup/routes.js — X router mount path is /x (not /api/x) because the Vite dev proxy strips the /api prefix before forwarding.
  • Remove oauth-1.0a from package.json — no longer needed since X API calls are removed entirely.

How to test:

  1. check into current branch
  2. do npm install, npm run build and npm run start to run this PR locally
  3. Clear site data/cache
  4. Follow instructions on frontend PR for the rest

one-community and others added 21 commits January 19, 2026 18:38
@marcusyi1 marcusyi1 force-pushed the Marcus-finishes-x-auto-poster branch from 7b152e0 to 4832cec Compare April 3, 2026 19:43
@marcusyi1 marcusyi1 force-pushed the Marcus-finishes-x-auto-poster branch from 9f7a4ae to 73ddb04 Compare April 3, 2026 19:53
@marcusyi1 marcusyi1 force-pushed the Marcus-finishes-x-auto-poster branch from 73ddb04 to e0c46af Compare April 3, 2026 19:58
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 3, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants