Skip to content

Merge upstream, fix docker build#133

Merged
erkinalp merged 166 commits intodefaultfrom
devin/1770669330-merge-upstream
Feb 11, 2026
Merged

Merge upstream, fix docker build#133
erkinalp merged 166 commits intodefaultfrom
devin/1770669330-merge-upstream

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Feb 9, 2026

Merge upstream/master: 155 commits from spacebarchat/server

Summary

Merges 155 upstream commits from spacebarchat/server into erkinalp/anticensor's default branch. This brings in:

  • Thread support (ThreadMember, ThreadMetadata entities, thread channel types)
  • Forum tags and tag management
  • User/member profile customisation
  • Auto-moderation improvements (typed params)
  • JSON serializer utilities
  • StopForumSpam integration
  • PostgreSQL migration scripts for threads, tags, and profiles
  • Various API route improvements and new endpoints

12 merge conflicts were resolved by merging both fork and upstream features (e.g., fork's TICKET_TRACKER + upstream's thread support in Channel.ts, fork's guild_id + upstream's thread_id in Message.ts).

A follow-up fix commit removes orphaned module exports for files that no longer exist (ThreadCreateSchema, ChannelPromoteSchema, LobbyCreateSchema, Array, Sentry, ConnectionPrivacy) and drops the stale missing-native-js-functions import from Permissions.ts. The husky pre-commit hook deprecation warnings are also fixed.

Updates since last revision (enum renumbering)

Fork-specific enum values in ChannelType and MessageType (in src/schemas/api/) were silently overwritten during git's auto-merge because only upstream modified those files from the merge base. These have been restored with new numbers to avoid clashing with upstream's assignments:

  • ChannelType (schemas): ENCRYPTED 7→19, ENCRYPTED_THREAD 8→20, TRANSACTIONAL 9→21, TICKET_TRACKER/KANBAN/VOICELESS_WHITEBOARD/CUSTOM_START unchanged (33/34/35/64).
  • MessageType (schemas + entity): CUSTOM_START 63→127, ENCRYPTED 16→128, ROUTE_ADDED 41→129, ROUTE_DISABLED 42→130, SELF_COMMAND_SCRIPT 43→131, ENCRYPTION 50→132. The entity Message.ts local enum was also updated to add upstream thread types (THREAD_CREATED, THREAD_STARTER_MESSAGE, etc.) and match the new fork numbers.
  • AllowedMentions.parse widened from ("users" | "roles" | "everyone")[] to string[] in both schemas and entity for plugin extensibility.
  • isTextChannel() fix (schemas): Re-added ENCRYPTED and ENCRYPTED_THREAD cases in src/schemas/api/channels/Channel.ts so encrypted channels are treated as text-capable.

Additional CI/type-groundwork in this revision:

  • Restored/extended @spacebar/util barrel exports (DateBuilder, ElapsedTime, TimeSpan, Stopwatch, Random, extensions, and networking subtree) to match new upstream structure
  • Corrected imports to @spacebar/schemas where appropriate (e.g., ChannelPermissionOverwrite, ChannelType, AutomodRuleSchema)
  • Cleaned up Message entity: removed obsolete dbEngine; added missing TypeORM types; imported PartialMessage; aligned with new flags usage
  • Added Permissions.ALL/Permissions.NONE static getters referenced by Channel entity
  • Implemented non-enumerable Array prototype helpers distinct()/single() (used by Channel) under util/extensions/Array.ts to replace removed polyfill
  • Installed missing runtime deps used by code: @protobuf-ts/runtime and @sentry/node
  • Husky: removed deprecated v10 shim lines from .husky/pre-commit
  • Nix build: minor flake updates visible in diff (e.g., npmBuildScript to build:tsgo, include scripts in source, clean up dist/src.tsbuildinfo, trim node_modules)

Updates since last revision (TypeScript error resolution)

All TypeScript compilation errors from the upstream merge are now resolved (139 → 0).

Key fixes:

  • MessageType imports: Moved from @spacebar/schemas to @spacebar/util across greet.ts, threads.ts, callback.ts to resolve enum type conflicts between the two packages
  • Message entity: Added pinned_at, interaction_metadata, message_snapshots fields; made message_reference.message_id optional and added type field
  • Message.create() typing: Added explicit as Message type assertions in greet.ts, pins.ts, messages/pins/index.ts to handle TypeORM overload issues
  • ChannelUpdateEvent/ChannelDeleteEvent: Fixed casting in tags.ts and delete.ts (pass channel directly instead of toJSON())
  • getPermission call: Fixed in threads.ts to pass channel.id instead of channel object
  • Message handler: Fixed interaction_metadata type conversion, PublicUser push to mentions array
  • AutoUpdate.ts: Use arrayBuffer() instead of missing bytes() method
  • Permissions.ts: Corrected getPermission signature and finalPermission user type
  • Embed type conflicts: Fixed between entity and schema packages using spread + cast pattern
  • Missing exports: Added RelationshipPatchSchema to schemas barrel file
  • Type dependencies: Added @types/express-serve-static-core and @types/ms as direct dev dependencies for pnpm module resolution
  • Pre-existing fixes: Fixed req.params type errors in consents/tickets routes (string | string[] → string casts)
  • Assets: Regenerated schemas.json and openapi.json; added pnpm-lock.yaml

Updates since last revision (CI runtime fixes)

  • Message.pinned_at column type: Added explicit type: "timestamp" to the @Column decorator. TypeORM cannot infer the correct PostgreSQL column type for Date | null without this, causing DataTypeNotSupportedError at runtime.
  • ConsentsAPI migration: Added CREATE TABLE IF NOT EXISTS "user_consents" before the ALTER TABLE statements. On a fresh database, the initial DDL doesn't include this fork-specific table, so the migration must create it first. The migration is now idempotent for both fresh and existing databases.

CI build-nix checks now pass.

Review & Testing Checklist for Human

  • Enum renumbering requires a data migration. If any DB rows store old fork numeric values, update them to the new numbers (MessageType: 16→128, 41→129, 42→130, 43→131, 50→132, 63→127; ChannelType: 7→19, 8→20, 9→21). TICKET_TRACKER (33), KANBAN (34), VOICELESS_WHITEBOARD (35) are unchanged.
  • ConsentsAPI migration on existing databases: Verify the migration runs cleanly on databases that already have user_consents table (the CREATE TABLE IF NOT EXISTS should be a no-op, and ADD COLUMN IF NOT EXISTS should skip existing columns).
  • Type assertions review: Several as Message, as string, and as Embed[] casts were added to suppress TypeScript errors. Spot-check that these don't mask real type mismatches at runtime, especially in pins.ts and Message.ts handler.
  • Message entity field additions (pinned_at, interaction_metadata, message_snapshots): Verify migrations handle these new fields across all supported databases. The pinned_at column uses type: "timestamp" which may behave differently across databases.
  • Run tests (pnpm test) and verify server boots (pnpm build && pnpm start). For full E2E, connect a Discord-compatible client and sanity check channel/message flows, especially pins and thread creation.

Notes

MathMan05 and others added 30 commits December 23, 2025 16:34
Bumps the npm_and_yarn group with 1 update in the / directory: [undici](https://github.com/nodejs/undici).


Updates `undici` from 7.16.0 to 7.18.2
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v7.16.0...v7.18.2)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.18.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
devin-ai-integration bot and others added 2 commits February 9, 2026 20:56
Merges upstream changes including:
- Thread support (ThreadMember, ThreadMetadata entities)
- Forum tags and channel types
- User/member profile customisation
- Auto-moderation improvements
- JSON serializer utilities
- StopForumSpam integration
- Various API route improvements
- PostgreSQL migration scripts

Conflict resolution: merged fork features (tickets, permissions)
with upstream additions (threads, tags) in all 12 conflicted files.
Also fixes husky pre-commit hook deprecation warnings.

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
- Remove ThreadCreateSchema, ChannelPromoteSchema, LobbyCreateSchema exports from schemas/uncategorised/index.ts (files don't exist)
- Remove Array, Sentry, ConnectionPrivacy exports from util/util/index.ts (files don't exist)
- Remove missing-native-js-functions import from Permissions.ts (package removed by upstream)

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
@devin-ai-integration
Copy link
Author

Original prompt from Erkin
I want to: Analyze Devin sessions

Devin session link: https://app.devin.ai/sessions/53cd1bd220114bfd96ccbdd85150eb43

@erkinalp/anticensor hmm, let's apply the patch bundle that we got, we somehow failed to apply

You only need to look in the following repo: erkinalp/anticensor

@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits February 10, 2026 04:44
Restore fork ChannelType values (ENCRYPTED, ENCRYPTED_THREAD,
TRANSACTIONAL, TICKET_TRACKER, KANBAN, VOICELESS_WHITEBOARD,
CUSTOM_START) and MessageType values (ENCRYPTED, ROUTE_ADDED,
ROUTE_DISABLED, SELF_COMMAND_SCRIPT, ENCRYPTION, CUSTOM_START)
that were silently overwritten during upstream auto-merge.

Values that conflicted with upstream's new assignments are
renumbered to avoid clashes while preserving non-conflicting
ones at their original numbers.

Also fix AllowedMentions.parse to use string[] for plugin
extensibility.

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
Give more room for upstream to grow (currently up to 63).
Fork custom types now start at CUSTOM_START=127.

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
Repository owner deleted a comment from devin-ai-integration bot Feb 10, 2026
Repository owner deleted a comment from devin-ai-integration bot Feb 10, 2026
@devin-ai-integration

This comment was marked as off-topic.

devin-ai-integration bot and others added 7 commits February 10, 2026 05:00
These were present on the default branch but lost during the upstream
merge because git auto-merged the schemas file (only upstream changed it
from the merge base). Without these cases, encrypted channels throw
'unimplemented' instead of being treated as text channels.

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
- Fix MessageType imports: use @spacebar/util instead of @spacebar/schemas
  across greet.ts, threads.ts, callback.ts to resolve enum type conflicts
- Fix Message.create() typing: add explicit type assertions
- Fix ChannelUpdateEvent/ChannelDeleteEvent casting
- Fix getPermission call: pass channel.id instead of channel object
- Fix Message handler: interaction_metadata type, PublicUser mentions
- Fix AutoUpdate.ts: use arrayBuffer() instead of missing bytes()
- Fix Message entity: add pinned_at, interaction_metadata, message_snapshots
- Fix Permissions.ts: correct getPermission signature and user type
- Fix Embed type conflicts between entity and schema packages
- Fix Message | null vs undefined type mismatch

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
- Add missing RelationshipPatchSchema export in schemas barrel file
- Add @types/express-serve-static-core and @types/ms as direct dev
  dependencies to fix pnpm module resolution for declaration emit
- Fix pre-existing req.params type errors in ticket, consents, and
  consent-grants routes (string | string[] -> string casts)
- Fix UserConsent.create() overload in consents service_id route

All TypeScript errors now resolved (was 139 after upstream merge).

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
- Regenerated assets/schemas.json and assets/openapi.json after
  adding RelationshipPatchSchema export
- Add pnpm-lock.yaml for reproducible dependency resolution

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
TypeORM cannot infer the correct PostgreSQL column type for Date | null
without an explicit type annotation. This caused a runtime
DataTypeNotSupportedError when connecting to postgres.

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
The ConsentsAPI migration assumed user_consents table already existed,
but on a fresh database the initial DDL doesn't include it. Add
CREATE TABLE IF NOT EXISTS before ALTER TABLE to handle both fresh
and existing database cases.

Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
@erkinalp erkinalp requested review from deffcolony and removed request for erkinalp February 10, 2026 14:02
@erkinalp erkinalp assigned deffcolony and unassigned erkinalp Feb 10, 2026
@erkinalp erkinalp added bug Something isn't working enhancement New feature or request Devin (Anthropic Claude) labels Feb 10, 2026
@erkinalp erkinalp changed the title Merge upstream/master: 155 commits from spacebarchat/server Merge upstream, fix docker build Feb 10, 2026
@erkinalp erkinalp removed the request for review from deffcolony February 11, 2026 17:48
@erkinalp erkinalp merged commit a42d741 into default Feb 11, 2026
2 checks passed
@erkinalp erkinalp deleted the devin/1770669330-merge-upstream branch February 11, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Devin (Anthropic Claude) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants