Skip to content

Implement message crosspost route#1644

Closed
samuelscheit wants to merge 4 commits intospacebarchat:masterfrom
samuelscheit2:fix/115-crosspost-message
Closed

Implement message crosspost route#1644
samuelscheit wants to merge 4 commits intospacebarchat:masterfrom
samuelscheit2:fix/115-crosspost-message

Conversation

@samuelscheit
Copy link
Copy Markdown
Member

@samuelscheit samuelscheit commented May 6, 2026

Closes #115

Summary

  • implement POST /channels/:channel_id/messages/:message_id/crosspost against persisted messages
  • enforce announcement-channel/default-message/already-crossposted semantics
  • emit MESSAGE_UPDATE after marking the message crossposted
  • add node:test coverage for crosspost helper behavior
  • format files required by style CI

Tests

  • npm run node:tests
  • npm run lint
  • npx prettier --check .

Copilot AI review requested due to automatic review settings May 6, 2026 07:18
@samuelscheit
Copy link
Copy Markdown
Member Author

Code review: I reviewed the current diff for PR #1644. No blocking issues found.

Notes:

  • Crosspost helper/test files were moved out of src/api/routes, avoiding accidental route registration by the recursive route loader.
  • Crosspost validation uses shared channel/message/flag constants and maps non-news, system-message, and already-crossposted cases to the appropriate API errors.
  • Local tests/lint/formatting passed after the style-format follow-up commit.

Approved from my review perspective.

@samuelscheit
Copy link
Copy Markdown
Member Author

Final report for assigned PR #166 / issue #115 work

Changed files:

  • .lintstagedrc.mjs
  • assets/openapi.json
  • assets/schemas.json
  • eslint.config.mjs
  • src/api/routes/channels/#channel_id/messages/#message_id/crosspost.ts
  • src/api/util/index.ts
  • src/api/util/utility/CrosspostMessage.ts
  • src/api/util/utility/CrosspostMessage.test.ts
  • src/cdn/util/Storage.ts
  • src/schemas/api/channels/Channel.ts
  • src/schemas/api/messages/Message.ts

Tests run and results:

  • npm run node:tests — passed, 58/58 tests including 5 crosspost helper tests; CrosspostMessage coverage 100%.
  • npm run lint — passed with 2 existing deprecation warnings in src/util/util/Token.ts and 0 errors.
  • npx prettier --check . — passed after formatting files checked by Style CI.

PR/check status:

Code-review outcome:

  • Reviewed the final diff and posted a review comment. No blocking issues found.
  • Decision: approved / no additional pass needed from my side unless CI or maintainers raise new objections.

@samuelscheit
Copy link
Copy Markdown
Member Author

CI update: all GitHub checks are now passing.

  • Style / build (24.x): success
  • Nix build / build-nix: success

No additional pass needed from my side.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@samuelscheit samuelscheit force-pushed the fix/115-crosspost-message branch from 0d96e33 to 996cdd9 Compare May 6, 2026 08:20
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.

Route: /channels/:id/messages/:id/crosspost

2 participants