fix: federated spaces in folders + DnD double indicator line

Remove FK constraint on space_folder_members.space_id so federated
space IDs (which don't exist in the local spaces table) can be added
to folders without silently failing. Add migration to recreate the
table for existing databases and explicit cleanup on space deletion.

Offset drop indicator lines by 3px into the mb-1.5 gap so adjacent
items share one visual position instead of showing two lines.

Extract TransferOwnershipModal (~165 lines) to its own file.
This commit is contained in:
Jannis Braun
2026-03-12 04:18:01 +01:00
parent 585988802d
commit b776e0e5b0
6 changed files with 205 additions and 177 deletions
+2 -1
View File
@@ -420,10 +420,11 @@ export async function spaceRoutes(app: FastifyInstance): Promise<void> {
return reply.code(403).send({ error: 'Only the space owner can delete the space', statusCode: 403 });
}
// Delete all channels (messages cascade), members, then server atomically
// Delete all channels (messages cascade), members, folder refs, then space atomically
db.transaction((tx) => {
tx.delete(schema.channels).where(eq(schema.channels.spaceId, id)).run();
tx.delete(schema.spaceMembers).where(eq(schema.spaceMembers.spaceId, id)).run();
tx.delete(schema.spaceFolderMembers).where(eq(schema.spaceFolderMembers.spaceId, id)).run();
tx.delete(schema.spaces).where(eq(schema.spaces.id, id)).run();
});