Commit Graph
921 Commits
Author SHA1 Message Date
Jannis Braun 58c6ec1dc6 fix: single-pass filter in discoverStore.removeUser 2026-04-03 04:27:25 +02:00
Jannis Braun 4c2e75b80c feat: handle deleted user cleanup in user_updated WebSocket handler 2026-04-03 04:23:18 +02:00
Jannis Braun 0f381c75db feat: add store methods for deleted user cleanup
Add removeRequestsForUser (socialStore), removeUser (discoverStore), and
clearTypingForUser (chatStore) to support isDeleted cleanup in the
user_updated WS handler.
2026-04-03 04:22:03 +02:00
Jannis Braun 9d4b759cb4 feat: add user_updated broadcast to federation identity delete, use shared helper
Switch from manual space-ID collection to collectDeletionBroadcastTargets and
add user_updated broadcast so clients patch their caches when a federated user
is deleted via S2S. Force-disconnect moved after broadcasts so other tabs
receive events before the connection is torn down.
2026-04-03 04:20:56 +02:00
Jannis Braun 5ef79ea8cd feat: broadcast member_left and user_updated on admin deletion 2026-04-03 04:19:58 +02:00
Jannis Braun 24351fba81 feat: broadcast member_left and user_updated on self-deletion 2026-04-03 04:19:09 +02:00
Jannis Braun 8c2587e90c feat: add collectDeletionBroadcastTargets helper for user deletion broadcasts 2026-04-03 04:18:10 +02:00
Jannis Braun 1d757ed839 fix(web): update DeleteIdentityDialog descriptions to match actual behavior 2026-04-03 03:57:34 +02:00
Jannis Braun 32133d20cc fix: orphaned DM cleanup runs in both modes, nuke deletes space messages
- Orphaned DM channels (zero members) are unreachable garbage — clean
  them up regardless of purgeContent mode, not just in full/nuke mode.
- Full/nuke mode now also deletes the user's space messages, their
  attachments, and embeds. This is the meaningful distinction: "Delete
  User" preserves all content as "Deleted User", "Nuke" removes it.
2026-04-03 03:50:52 +02:00
Jannis Braun c0e6c4019d fix: filter isDeleted=0 in identity delete endpoint user lookup
After a prior deletion + re-federation, multiple user records share
the same homeUserId (one deleted, one live). The unfiltered .get()
returned the older deleted record, causing the idempotency check to
short-circuit and miss the live record entirely.
2026-04-03 03:23:16 +02:00
Jannis Braun ca3f490bda feat: federation identity delete via S2S relay
Three deletion modes for federated identities:
- Leave quietly: client-only disconnect
- Delete User: S2S soft-delete (anonymize, keep messages)
- Nuke everything: S2S full tombstone (purge DM data)

New endpoints:
- DELETE /api/federation/identity (HMAC-authenticated S2S)
- POST /api/users/@me/federation-identity/delete (home-side trigger)

Also: tombstoneUser purgeContent option, zombie stub prevention,
updated dialog UI with scope selector.
2026-04-03 02:56:48 +02:00
Jannis Braun 0ff20beedf docs: update subsystem docs for federation identity delete feature 2026-04-03 02:51:50 +02:00
Jannis Braun c918199cee feat: wire up DeleteIdentityDialog with S2S deletion modes and scope
Update the dialog to support three deletion modes (leave/soft/full),
scope selector with disabled "Select instances..." option, loading
state during deletion, and per-instance error handling via toasts.
2026-04-03 02:48:35 +02:00
Jannis Braun e7be58f01d feat: implement deleteIdentity with S2S relay for soft/full modes 2026-04-03 02:43:55 +02:00
Jannis Braun abd5ad145a feat: add deleteFederationIdentity API client method 2026-04-03 02:41:18 +02:00
Jannis Braun 793a3967be feat: add DELETE /api/federation/identity S2S endpoint 2026-04-03 02:38:42 +02:00
Jannis Braun 97470a4d3a feat: add home-side federation identity delete trigger endpoint 2026-04-03 02:38:35 +02:00
Jannis Braun 2c09953864 fix: scope zombie guard by homeInstance to prevent cross-instance false matches
homeUserId snowflakes aren't globally unique — must also match
homeInstance to avoid blocking stub creation for unrelated users.
2026-04-03 02:35:06 +02:00
Jannis Braun 4da373c970 fix: prevent resolveOrCreateReplicatedUser from recreating deleted user stubs
When a federated user's identity has been tombstoned (isDeleted=1),
findFederatedUser filters them out, causing resolveOrCreateReplicatedUser
to silently create a new stub — a "zombie" resurrection. This guard checks
for a deleted row before creating a stub and returns null instead.

All 11 call sites across federation.ts and dm.ts have been updated with
appropriate null guards: federation relay handlers reject or skip the event
(participant_not_found / accepted no-op), while dm.ts routes convert null
to undefined so the existing 404 path handles it.
2026-04-03 02:32:36 +02:00
Jannis Braun bb4b031423 feat: add purgeContent option to tombstoneUser for soft-delete mode 2026-04-03 02:30:00 +02:00
Jannis Braun 867caa5f31 feat: add federation identity delete request/response types 2026-04-03 02:28:45 +02:00
Jannis Braun 54b7877472 fix(web): fetch members on mount in TransferOwnershipModal
The modal read from the global spaceStore.members which only contains
members for the currently active space. Opening the modal via right-click
context menu on a space that hasn't been navigated to yet resulted in an
empty member list. Now fetches members independently via the dedicated
GET /api/spaces/:id/members endpoint with federation-aware API routing.
2026-04-03 01:37:03 +02:00
Jannis Braun d0864f13b9 fix(web): use Avatar component in TransferOwnershipModal for proper fallback colors
The modal was manually rendering avatars with a static bg-surface-input
background, bypassing the Avatar component's getAvatarGradient() logic.
Users without profile pictures got blank dark circles instead of their
hash-generated or user-set avatar color gradients.
2026-04-03 01:27:51 +02:00
Jannis Braun a07f2314ed fix(web): standardize modal button layout across all dialog modals
Apply symmetrical full-width button pattern to:
- Delete Identity dialog (ConnectedInstances)
- Transfer Ownership confirmation
- Image Crop modal
2026-04-03 01:15:14 +02:00
Jannis Braun 5b9b7fc107 fix(web): redesign ConfirmDialog with symmetrical full-width buttons
- Remove tinted description box, use plain text
- Buttons are now flex-1 equal width side by side
- Cancel gets visible bg-interactive-hover background
- Larger padding, rounded-xl, wider max-w
2026-04-03 01:07:31 +02:00
Jannis Braun 3152c66bd2 fix(web): restore original rounded separator style on friend rows 2026-04-03 01:02:53 +02:00
Jannis Braun 23517447c3 fix(web): flat separators with wrapper divs, first-row border, DM sidebar title case
- FriendItem/RequestItem: add plain wrapper div so divide-y border
  lands on a non-rounded element (fixes curved separator lines)
- Add border-t to divide-y containers so first row also gets top line
- Remove uppercase from "Direct Messages" in DM sidebar
2026-04-03 00:58:03 +02:00
Jannis Braun e16cedded7 feat(web): add confirmation dialog for unfriend action 2026-04-03 00:48:28 +02:00
Jannis Braun fbd69b09cf fix(web): use title case for all Friends page headers 2026-04-03 00:47:19 +02:00
Jannis Braun 33f5edb419 fix(web): use divide-y for flat friend row separators 2026-04-03 00:46:03 +02:00
Jannis Braun c5eddff084 fix(web): friends page header, button visibility, and status casing 2026-04-03 00:44:48 +02:00
Jannis Braun 1236744c46 refactor(web): remove unused isSameCounterpart and deduplicateDmChannels from spaceStore
These functions were superseded by the DM deduplication fix in
32d9647. Clean up the dead code and unused identity imports.
2026-04-03 00:04:50 +02:00
Jannis Braun c7eab559d5 fix(web): respect user-disconnected federation instances on reload
Add third group for instances the user explicitly disconnected via
the registry. These get a disconnected placeholder with preserved
token for instant reconnect, but no auto-connect on page load.
2026-04-03 00:04:46 +02:00
Jannis Braun 5e778f400b fix(server): use two-step MAX(created_at) for DM last message in ready payload
Aligns the ready payload query with the GET /api/dm approach:
get MAX(created_at) per channel first, then fetch the actual
message rows. Avoids issues with federated relay messages whose
local snowflake IDs don't match chronological order.
2026-04-03 00:04:40 +02:00
Jannis Braun d7f82d5496 refactor(web): use DmListItem in ChannelSidebar, align nav item geometry
Replace ~105 lines of inline DM rendering with <DmListItem>.
Update Friends and Coming Soon nav items to rounded-[6px].
2026-04-02 23:50:48 +02:00
Jannis Braun f7b8770cab feat(web): extract DmListItem component with visual refinements
Extracts the inline DM list item rendering (~105 lines) from
ChannelSidebar.tsx into a standalone component. Applies cohesive
hover states, 6px border radius, 44px row height, and a selected-
state accent bar matching ChannelItem's pattern.
2026-04-02 23:44:03 +02:00
Jannis Braun 32d9647ed1 fix(web): deduplicate DM sidebar entries for federated users
When the same person registers on multiple federated instances, separate
DM channels are created for each identity, causing duplicate sidebar
entries (e.g., "Nova" appearing twice — once for local, once for
federated account).

Add deduplicateDmChannels() safety net that detects matching counterparts
using two layers: canonicalUserMatch (same ID/homeUserId/username) and
replicatedInstances cross-check (local user has a replicated account on
the federated user's home instance with the same base username). Keeps
the DM with the most recent activity, applied in both setDmChannels and
populateFromReady.

Investigation: queried both live instances (nova.ddns.net, orbit)
and confirmed root cause is same-person-two-accounts, not a server-side
creation bug or identity resolution gap.
2026-04-02 18:11:18 +02:00
Jannis Braun c7c86007c4 feat(web): render smart timestamps and attachment-aware previews in DM sidebar 2026-04-02 18:00:02 +02:00
Jannis Braun 1260f69ed0 fix(web): fix type errors in dmFormatters PreviewAttachment handling 2026-04-02 17:57:44 +02:00
Jannis Braun b77aad61eb refactor(web): unify DM sorting with sortDmChannels across all triggers 2026-04-02 17:56:26 +02:00
Jannis Braun afa583df1d feat(server): include attachment metadata in GET /api/dm lastMessage 2026-04-02 17:53:14 +02:00
Jannis Braun 6e5792ff72 feat(server): include attachment metadata in ready payload DM lastMessage 2026-04-02 17:51:37 +02:00
Jannis Braun b82733868b feat(web): add formatDmPreview utility with attachment-aware previews
Supports text-only, attachment-only (with type-specific icons), and
mixed messages. PreviewAttachment accepts both type/filename (ready
payload) and mimetype/originalName (Attachment type) field shapes.
2026-04-02 17:48:28 +02:00
Jannis Braun 68fe04ef58 feat(web): add sortDmChannels utility with unread-first sorting 2026-04-02 17:48:24 +02:00
Jannis Braun 03667947aa feat(web): add formatDmTimestamp utility with smart date formatting 2026-04-02 17:47:18 +02:00
Jannis Braun 416636530a feat(shared): add DmLastMessagePreview type with attachment metadata
Introduces a lightweight DmLastMessagePreview interface for the ready
payload and GET /api/dm response, and widens DmChannel.lastMessage to
accept either DmLastMessagePreview or DmMessageWithUser so both the
static preview path and real-time WS events can coexist without casts.
2026-04-02 17:45:23 +02:00
Jannis Braun c9d2423c38 docs: add federation filtering note to ready payload spec 2026-04-02 11:38:25 +02:00
Jannis Braun 1d81838868 feat(server): filter DM read states from ready payload for federated users 2026-04-02 11:33:59 +02:00
Jannis Braun b1ba7b35d2 feat(server): skip DM channel queries in ready payload for federated users 2026-04-02 11:33:51 +02:00
Jannis Braun 54bce681f9 feat(server): add isFederated flag and visibleChannelIdSet to ready payload builder 2026-04-02 11:33:43 +02:00