Commit Graph
1536 Commits
Author SHA1 Message Date
Jannis Braun 38a3d4fba8 docs(api,federation): tus upload endpoints; federation worker boundary note 2026-05-02 17:16:00 +02:00
Jannis Braun fb7add4f83 docs(uploads): tus protocol, three-store architecture, download pipeline, capability matrix 2026-05-02 17:15:38 +02:00
Jannis Braun 348800bfca feat(web): channel-header transfer indicator + global tray panel 2026-05-02 17:11:41 +02:00
Jannis Braun 0be69808e4 feat(web): right-click Save Video / Save Audio via transferStore 2026-05-02 17:07:39 +02:00
Jannis Braun aaa15cef88 feat(web): file-card download routes through transferStore 2026-05-02 17:06:26 +02:00
Jannis Braun d3f45dbda4 feat(web): saveImage routes through transferStore 2026-05-02 17:05:51 +02:00
Jannis Braun 2be243336b feat: all profile uploads through transferStore; delete legacy POST /api/uploads
Migrates the remaining 5 profile/space upload sites (CreateSpace, AccountPanel
avatar+banner, OverviewPanel icon+banner) to transferStore.startUpload with
tray:false. Space sites pass _instanceOrigin so uploads route to the space's
home instance.

Removes upload/uploadWithProgress from api.uploads (and their private
uploadFile/uploadFileWithProgress helpers); api.uploads.url is preserved for
GET-path URL building. Deletes the server-side POST /api/uploads handler and
the now-unused @fastify/multipart plugin registration. GET /api/uploads/:filename
remains intact.
2026-05-02 16:46:29 +02:00
Jannis Braun 727c51f659 feat(web): RegisterPage avatar uses transferStore + waitForTransfer helper
Replaces the legacy /api/uploads call in RegisterPage with the tus-based
transferStore path. Extends Transfer to persist the server-assigned
filename (not just attachmentId) since downstream consumers store
attachment.filename on the user/space record.

- transferStore: rename setAttachmentId -> setAttachmentRef(id, attachmentId, filename)
  and add attachmentFilename field to Transfer
- both startUpload + resumeUpload onSuccess paths now record filename
- new utils/waitForTransfer.ts: waitForTransferAttachment(transferId)
  returns {attachmentId, filename}, with immediate-terminal handling
- RegisterPage: silent (tray:false) upload via transferStore, awaits
  the helper, passes the server filename to api.users.update
2026-05-02 16:40:50 +02:00
Jannis Braun 48d199515a feat(web): chatStore dedups WS echo against pendingMessageStore (FIFO) 2026-05-02 16:37:22 +02:00
Jannis Braun e534644e57 feat(web): Message renders pending-bubble overlay + retry/discard chrome 2026-05-02 16:31:53 +02:00
Jannis Braun 7b6586110d feat(web): MessageList interleaves pending bubbles by createdAtLocal 2026-05-02 16:28:21 +02:00
Jannis Braun b97326ef18 feat(web): MessageInput uses composerStore + transferStore (eager upload, FS handles) 2026-05-02 16:17:49 +02:00
Jannis Braun 65d8a19c87 feat(web): AttachmentProgress overlay component 2026-05-02 16:02:47 +02:00
Jannis Braun 5128a625b8 feat(web): pending-message orchestrator (TTL discard, deferred send, online retry) 2026-05-02 16:00:30 +02:00
Jannis Braun b01ad4edb8 feat(web): pendingMessageStore with FIFO dedup matcher and TTL discard 2026-05-02 15:49:59 +02:00
Jannis Braun c986f734ee feat(web): composerStore (per-channel draft + staged transfer ids) 2026-05-02 15:41:55 +02:00
Jannis Braun 2864d84a0f feat(web): transferStore.startDownload + pause/resume/abort with FS-handle path 2026-04-30 02:16:38 +02:00
Jannis Braun bde00e2d9f feat(web): transferStore upload + resume via tus-js-client 2026-04-30 02:11:43 +02:00
Jannis Braun bdfe7b453a feat(web): transferStore skeleton with versioned persistence 2026-04-30 02:06:17 +02:00
Jannis Braun 054f063f1f feat(web): IDB persistence + capability detection for FileSystemFileHandle 2026-04-30 02:03:01 +02:00
Jannis Braun 097976538d deps(web): add tus-js-client, idb, fake-indexeddb 2026-04-30 02:00:43 +02:00
Jannis Braun 2e6dabd7ff feat(server): janitor sweeps for tus expired uploads and stragglers 2026-04-30 01:56:39 +02:00
Jannis Braun 974fbf759e feat(server): tus upload endpoint at /api/files with auth, ownership, size, finalize hooks 2026-04-30 01:50:03 +02:00
Jannis Braun 21022eaa73 feat(server): tus hook helpers (metadata parse, extension extract, ownership check) 2026-04-30 01:17:16 +02:00
Jannis Braun 9902130916 feat(server): config keys for tus upload directory and expiration 2026-04-30 01:11:34 +02:00
Jannis Braun 4477554f8a deps(server): add @tus/server and @tus/file-store 2026-04-30 01:08:26 +02:00
Jannis Braun f538f1d92e fix(desktop): enable PulseAudio loopback flag so screen share starts on Linux
Chromium gates the PulseAudio loopback path behind the
PulseaudioLoopbackForScreenShare feature flag. Without it, returning
audio: 'loopback' from setDisplayMediaRequestHandler rejects the whole
getDisplayMedia request, so screen share never starts when the user has
"Share system audio" enabled. Also surface a clear warning toast on
loopback failure (PipeWire-only without pulse compat, macOS without
Catap) instead of failing silently — no auto-retry, since the picker
selection is already consumed.
2026-04-29 23:43:44 +02:00
Jannis Braun e0861597bc fix(web): portal overlays into fullscreenElement so they render in voice fullscreen
requestFullscreen() on the voice container puts only its descendants in the
browser's top layer; overlays portaled to document.body were rendered outside
that layer and stayed invisible — most visibly the right-click context menu on
stream tiles and voice user panels.

Add usePortalContainer() hook returning document.fullscreenElement ?? document.body
and re-rendering on fullscreenchange. Migrate every overlay reachable during a
call: ContextMenuRenderer (desktop, submenu, mobile sheet), Tooltip,
ConfirmDialog, ConnectionInfoPopover, ScreenShareSettingsPopover, and
ScreenSharePicker (which previously rendered inline at App root).
2026-04-29 23:32:14 +02:00
Jannis Braun 1ed70a90b1 fix(dm): render system messages in sidebar preview instead of raw JSON
DmLastMessagePreview lacked a `type` field, so the sidebar rendered
`lastMessage.content` verbatim — surfacing JSON like
`{"event":"space_invite",...}` for space invites and member-add events.

Adds `type` to the preview payload (populated server-side from
`dm_messages.type`) and routes all sidebar call sites through a single
`formatDmSidebarPreview` helper that renders human-readable text for
each system event and skips the group `Sender:` prefix on system rows.
2026-04-29 23:13:09 +02:00
Jannis Braun 9aa97f4552 fix(web): joinByCode normalizes explicit home origin to local
When a caller passes the user's own instance origin (e.g. from an invite
snapshot's spaceInstanceOrigin), strip it to undefined before the remote
branch so the local api path is taken instead of erroneously failing with
NotConnectedError. Mirrors inviteParser's identical normalization.
2026-04-29 22:52:47 +02:00
Jannis Braun 85987a891c fix(web): SpaceInviteCard navigates to /channels/:spaceId (not the non-existent /spaces/:id) 2026-04-29 22:44:35 +02:00
Jannis Braun d8b08d8990 fix(web): SpaceInviteCard navigates to space on already-member instead of showing error 2026-04-29 22:41:49 +02:00
Jannis Braun bc66ddc633 fix(server): canonicalize spaceInstanceOrigin before storing payload
Empty-string (local) origin is now stored as the absolute home origin
so relayed DM space-invite cards carry the correct value to remote
recipients instead of resolving against the wrong instance.
2026-04-29 22:35:34 +02:00
Jannis Braun 44e9a4234c fix(server): local-fast-path for invite snapshot — skip HTTP self-reach
POST /api/dm/space-invite was hanging 5s and returning invite_invalid
for any local-space invite. fetchSpaceInviteSnapshot was being called
against our own public domain from inside the backspace container, which
fails (Docker NAT loopback) and aborts on timeout.

Add getLocalInviteSnapshot — reads the snapshot directly from the DB —
and branch in dm.ts so local invites bypass the HTTP roundtrip entirely.
Cross-instance invites still go through fetchSpaceInviteSnapshot with
its existing SSRF guard.

Also refactor the GET /api/spaces/invite/:code/preview handler to use
the same helper, keeping the snapshot shape in one place.

Tests assert fetchSpaceInviteSnapshot is NOT called for the local case
(critical regression guard) and that the cross-instance path still hits
the HTTP fetch.
2026-04-29 22:29:44 +02:00
Jannis Braun 5481eb9e7e fix(server): SSRF guard on cross-instance invite preview fetch 2026-04-29 22:19:10 +02:00
Jannis Braun 4476c55963 docs: invite friends overhaul — space_invite system message, relay type field, in-instance /join interception 2026-04-29 22:11:56 +02:00
Jannis Braun 65ca54f556 feat(web): useDeepLinkHandler also subscribes to onOpenInternalRoute 2026-04-29 22:09:20 +02:00
Jannis Braun 7d98558816 feat(web): push connected-instance origins to Electron main process 2026-04-29 22:08:30 +02:00
Jannis Braun b00d21df0e feat(desktop): preload exposes setConnectedOrigins + onOpenInternalRoute 2026-04-29 22:07:26 +02:00
Jannis Braun eb57d2fd5c feat(desktop): intercept own-instance /join URLs in setWindowOpenHandler 2026-04-29 22:05:50 +02:00
Jannis Braun a46d35f5f8 feat(web): InviteModal — friend picker + restyled share-link footer, drop deep link 2026-04-29 22:02:23 +02:00
Jannis Braun 1859f2963c feat(web): SystemMessage dispatches space_invite to SpaceInviteCard 2026-04-29 21:55:06 +02:00
Jannis Braun e351d53dd5 fix(web): SpaceInviteCard — real embed idiom and correct getApiForOrigin import path 2026-04-29 21:52:20 +02:00
Jannis Braun 82533c1434 feat(web): SpaceInviteCard component with snapshot/live/revoked render states
Renders space invite system messages in DMs as embed-style cards on the chat
surface. Three render states: snapshot-only on mount (Join enabled, loading
dot), live-confirmed (memberCount refreshed from preview), revoked (gray-out
+ glass-pill indicator). Join targets the space's home origin via
joinByCode(code, spaceInstanceOrigin || undefined) — the three-way
federation correctness rule. Re-exports getApiForOrigin from api/client to
expose the cross-store resolver under a natural import surface.
2026-04-29 21:50:01 +02:00
Jannis Braun 657cc0e1b9 feat(web): add dm.spaceInvite() api client method 2026-04-29 21:44:40 +02:00
Jannis Braun 7303c23b20 test(server): integration tests for POST /api/dm/space-invite 2026-04-29 21:43:25 +02:00
Jannis Braun 5cb0aa9d66 feat(server): POST /api/dm/space-invite endpoint with rate-limited per-friend invite
Adds POST /api/dm/space-invite which fetches a space-invite snapshot
server-to-server from the space's home instance, ensures a 1-on-1 DM
between the caller and a friend, and posts a type='system' message
carrying SpaceInviteSystemPayload. Snapshot is never trusted from the
client. Rate-limited 30/60s per caller. Federation relay queued when the
recipient is on a remote instance (system message type forwarded by
Tasks 1-3).

Adds an `ensureOneOnOneDmChannel` helper that mirrors the dedup-or-create
behavior of the existing POST /api/dm handler — including federatedId
computation and the dm_channel_created notification payload — without
modifying that handler. Duplication is intentional; consolidation is a
separate follow-up.
2026-04-29 21:37:44 +02:00
Jannis Braun 855410f88c feat(shared): add SpaceInviteRequest / SpaceInviteResponse / SpaceInviteSystemPayload 2026-04-29 21:34:07 +02:00
Jannis Braun 889dfe9b4a feat(server): add fetchSpaceInviteSnapshot helper for cross-instance preview fetch 2026-04-29 21:33:19 +02:00
Jannis Braun c4f84f8c68 test(federation): buildRelayPayload type-field forwarding 2026-04-29 21:31:56 +02:00