Skip to content

Recipe/main - #46

Merged
m335671 merged 46 commits into
mainfrom
recipe/main
Sep 19, 2026
Merged

m335671 merged 46 commits into
mainfrom
recipe/main

Conversation

@MisterPapaye

Copy link
Copy Markdown
Member

No description provided.

m335671 and others added 30 commits September 19, 2026 01:21
- .gitattributes: force LF on src-tauri/linux/** so a Windows checkout
  doesn't corrupt the generated .desktop file (Icon=app\r never matched
  any icon file, breaking linuxdeploy's AppImage packaging).
- release_main.yml (local act copy only, untouched real CI workflow):
  add libfuse2t64 for linuxdeploy, drop APPIMAGE_EXTRACT_AND_RUN (races
  under act/Docker) in favor of real FUSE via --privileged, and chain
  all build jobs with needs: so they run sequentially instead of
  concurrently — running them in parallel under act shares the same
  working directory across jobs (no per-job VM isolation like real
  GitHub Actions), which corrupted .env/.env.production mid-build and
  shipped a release APK pointing at http://localhost:9000 instead of
  the real API URL.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011MfVvAw1QC9scoKQMRyj3u
…pImage

The AppImage runtime (linuxdeploy) exports LD_LIBRARY_PATH, GTK_PATH,
GIO_EXTRA_MODULES, GDK_PIXBUF_MODULE_FILE, GST_PLUGIN_* etc. pointing at
its own bundled libs. tauri-plugin-shell's open() inherits that
environment when it shells out to xdg-open, so the browser it launches
for the OAuth login also inherits it and tries to load the bundled
libs instead of its own — e.g. Firefox aborts with "XPCOMGlueLoad
error ... libnss3.so: version `NSS_3.126' not found". The browser
never opens, the login promise just hangs waiting for a deep-link
callback that will never arrive.

Reproduced locally: spawning xdg-open under that exact env crashes
Firefox with the NSS version mismatch above.

Add a small `open_external_url` Tauri command that spawns the
platform opener (xdg-open/open/cmd) itself, stripping the
AppImage-injected vars on Linux, and use it instead of
plugin-shell's open() for the login flow — the only call site.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
bundleMediaFramework bundles the CI runner's entire GStreamer plugin
set, including libgstfluidsynthmidi.so — a MIDI synth plugin the app
never uses that links against pipewire's JACK compat shim. On a
system whose pipewire is missing the symbol it expects
(pw_log_topic_register), loading it segfaults the plugin scanner
during startup, crashing the AppImage before any window appears
(reported log: "GStreamer-WARNING ... undefined symbol:
pw_log_topic_register" then "child exited with code 11").

Verified locally that this is the only bundled plugin depending on
libjack/libpipewire in that way, so dropping it doesn't touch
screen-share (libgstpipewire.so/libpipewire itself stay bundled).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e it opens

ThreadsBar.vue re-mounts every time you navigate to/from Tasks/Agenda/Home
(it's behind a route-based v-if in OrgLayout.vue). Its "recent DMs" list
was local component state, re-fetched from /api/users/me/dms/recent on
every single mount and starting empty each time — hence the visible
delay and the sort order "jumping" once the response arrived, which the
user reported.

Moved that state into a new shared composable (useRecentDMs.ts, module-
level state like useProfile.ts/useNotification.ts already do), fetched
once per session from OrgLayout.vue (always mounted for the org's
lifetime) and kept live by its existing persistent notif:dm:new-message
listener. ThreadsBar.vue now just reads the shared ref — no more local
fetch or socket subscription, and the list is already correct the
instant the panel opens.

feat(dm): open the last conversation by default (desktop only)

ChatView.vue previously redirected an empty /chat route to
openedOrg.members[0] — an arbitrary first member, not the most recently
talked-to one. Now uses getMostRecentDMUserId() from the same shared
cache, and only auto-redirects when !isLittleScreen — on mobile the
route already relies on showView=0 (set by the "Messages privées" nav
link) to show the conversation list instead, and auto-navigating there
too would silently attach a userId to the URL behind that hidden panel.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
getUnreadCountByDMUserId() returns a fresh computed() on every call
(cf. useNotification.ts) — ChatUserBtn.vue called it inline in the
template at two separate spots, so every re-render of the DM contact
list built and immediately discarded two new computed refs (each doing
a full filter over all notifications) per row. Memoized as a single
`hasUnread` computed in the component instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…reens

/banner.svg has white text baked in, meant for the dark background
(bg-(--bg2)) these screens use by default — invisible/barely visible
once the user switches to light theme. Switched to the existing
light_banner_synco.svg (black text) when theme === 'light', on both the
PIN unlock/setup screen and the Tauri desktop login screen. The asset
was already present in public/assets/logo/synco/ but never referenced
anywhere in the app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…sage

ChatMessage.vue has two root nodes (the message bubble + ConfirmDelete),
so Vue can't auto-forward the id="msg-..." attribute ChatView.vue binds
directly on the component — pre-existing, unrelated to the recent DM
changes. Disabled auto attrs inheritance and forward $attrs onto the
bubble div explicitly, same fix pattern Vue recommends for multi-root
components.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Three related bugs in the private-call (PeerJS) notification flow:

- No 'close' listener was attached to an incoming call before it was
  answered, so if the caller hung up while it was still ringing, the
  callee's ringtone/enteringCall/notification never cleared — the
  "Répondre" button stayed pointing at an already-closed call forever.
- accept/rejectCall only filtered callNotif (the OrgMember list), never
  the actual Notification objects rendered by Notifications.vue, so the
  "Appel entrant" card itself never disappeared after being answered or
  declined. Fixed by syncing notifications.value whenever callNotif
  shrinks, regardless of which path removed the entry.
- The generic dismiss "x" on a call notification just hid the card
  without hanging up, leaving the call ringing in the background with
  no way to act on it afterward. Removed for notif:call — "Refuser" is
  now the only way to close it, since that one actually ends the call.

Also fixed the same "answering doesn't clear the notification" gap on
notif:privateMeet's "Répondre" button, and reset ringtone.currentTime
on reject so the next incoming call doesn't start mid-clip.
The space:updated handler bailed out immediately whenever the space
wasn't already in openedOrg.spaces — exactly the case for someone who
was just added to it, so the "I'm now a member, fetch and show it"
branch a few lines below was unreachable for that person. Restructured
so an unknown space is only ignored when I'm not in its member list,
and pushed into the sidebar otherwise. Pairs with the synco_api fix
that made the underlying broadcast actually reach anyone.
- NotificationItem.vue (notification bell/inbox): the live-pushed
  notification never has `sender` populated (createAndSendNotification
  doesn't include it), so displaySender always fell back to "Système".
  Now falls back to metadata.senderName (already sent by the backend
  for messages), and shows the sender's real avatar instead of a
  generic envelope icon when metadata.senderAvatar is present.
- useNotification.ts: MESSAGE notifications now trust the backend's
  data.route (just fixed to point at the real, org-scoped chat routes
  with the message highlighted) instead of hand-rolled paths that never
  matched the router. Also stopped firing the generic "Vous avez reçu
  un nouveau message" toast for MESSAGE notifications — that type
  already gets a proper toast with avatar/name/preview/click-to-message
  from useNotifications.ts (via notif:new-message / notif:dm:new-message),
  so this one was just a redundant, worse duplicate popping up for every
  single chat message, even ones in the thread you're already viewing.
- firebase-messaging-sw.js: the notification click handler only read
  `notification.data.url`, but every other part of the app uses `route`
  — so clicking a desktop/web push notification always fell through to
  opening "/" regardless of what the message was about.
useRoute() was called at the top of initListener(), but every caller
(Notifications.vue, ChatView.vue, ThreadView.vue) invokes it from an
onMounted callback that has already crossed at least one prior await
(permission checks, waitForSocketConnection, ...). Vue's composition
API context (getCurrentInstance) doesn't survive an await boundary
inside a lifecycle hook, so useRoute()'s injection silently resolved to
undefined and got captured in the handler's closure — the very first
notif:new-message crashed with "route is undefined" and no in-app
toast ever showed for anyone.

Swapped for the app's router singleton (already imported the same way
elsewhere, e.g. App.vue), read live inside the handler instead of
captured once — sidesteps the component-context requirement entirely.
bundle.icon never listed icons/icon.png (512x512), only the
128x128/128x128@2x/32x32 PNGs plus the macOS/Windows formats. Without
a properly-sized standard icon, linuxdeploy's AppImage output plugin
doesn't create the root-level app.png link that appimagetool requires
to match the desktop entry's Icon= field, so the whole Linux bundling
step (deb/rpm/AppImage) fails: "app{.png,.svg,.xpm} defined in desktop
file but not found".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The rich notif:msg/notif:dmmsg toast (Notifications.vue) was rendering
the actual message text — for thread messages, and even the DM path,
which went out of its way to decrypt the E2EE content client-side just
to display it in a toast. A notification should only ever reveal who
sent something, their avatar, and where (thread name) — never the
content, encrypted or not.

- Notifications.vue: replaced the content/embed-title line with
  "dans <threadName>" for channel messages, and a static "Nouveau
  message privé" for DMs.
- useNotifications.ts: strips `content` off the object before it's
  even stored, and carries the new `threadName` field from the backend
  instead.
- OrgLayout.vue: removed the DM decrypt-just-to-display step entirely
  (decryptFromPeer no longer used here) — no reason to touch the
  private key at all for a notification that never shows the text.
notif:msg, notif:call and notif:privateMeet all fell back to an empty
string (`|| ''`) when the user had no avatarUrl — a broken <img> instead
of anything useful. Switched to the same ui-avatars.com initials
convention used everywhere else in the app (notif:dmmsg already did
this correctly). Same fix in NotificationItem.vue (the notification
bell/inbox), which previously fell back straight to a generic type
icon even when a real sender name was known.
The 1:1 private call (useSecurePeer.ts, PeerJS + E2EE) had its own
bolted-on UI with none of what voice threads (useLiveKit.ts +
VoiceThreadView.vue) already got: no mic/camera/speaker selection, no
video quality settings, and a visually inconsistent overlay.

- CallControls.vue: decoupled from useLiveKit — switchDevice and
  applyVideoQuality are now props instead of being imported directly,
  so the same square-button/dropdown control bar can be shared by both
  calling systems. applyVideoQuality's source parameter is now the
  generic 'camera' | 'screenshare' instead of LiveKit's Track.Source,
  removing the livekit-client import from this component entirely.
  Added showInvite (default true) since a private call is always 1:1,
  no group-invite concept.
- useSecurePeer.ts: added switchDevice, applyVideoQuality,
  toggleDeafen/isDeafened (simple mute — no GainNode/per-participant
  volume, unnecessary at 2 people), registerRemoteMediaElement (for
  setSinkId), and remote-speaking detection (reusing the existing
  monitorAudio helper on the incoming stream). toggleCam/
  toggleScreenShare now take optional capture options, and
  startCall/acceptCall apply the saved mic device — same
  voicePrefs.ts / localStorage key already used by voice threads, so
  device/quality choices are shared across both calling systems.
- CallOverlay.vue: rebuilt the video area around the same tile
  language as VoiceThreadView.vue — big tile for the remote peer
  (their video, or their avatar with a speaking ring) with a floating
  PiP self-tile, instead of the old ad-hoc layout. The "ringing"
  state now shows the actual person being called (avatar + name)
  instead of a generic pulsing icon. Bottom controls are now the
  shared CallControls component. Kept the working SAS/E2EE
  verification panel, timer, and minimized DraggableWindow mechanics
  as-is.
- VoiceThreadView.vue: one-line adapter passing its own
  switchDevice/applyVideoQuality into CallControls' new prop
  interface (Track.Source mapping stays local to this file).
Two bugs visible in a live test's console output:

- handleCallEvents() generated its own random callId independently on
  each side (caller and callee), so they could never match. Every key
  exchange message failed handleKeyExchangeMessage's callId check
  ("possible session hijacking attempt") and the E2EE handshake never
  completed on any call — visible as a repeating
  open/reject/close/timeout cycle on the data channel. Fixed by having
  the caller generate the callId once and send it via the call's
  metadata (already used for e2ee/version/publicKeyJWK); the callee
  now reads it from there instead of generating its own.
- CallOverlay.vue's startTimer() called onUnmounted() from inside a
  watcher callback, not synchronously during setup() — Vue can't
  attach a lifecycle hook there (logs a warning and registers
  nothing), so the interval was never actually cleared. Moved to a
  tracked interval id cleared by stopTimer(), called from the
  component's single top-level onUnmounted().
crypto.subtle.deriveKey()'s 3rd parameter (derivedKeyAlgorithm) must
describe the FINAL key's algorithm, not a second derivation step —
chaining ECDH straight into {name:'HKDF', hash, info, salt} there isn't
a valid single-step call (WebCrypto rejected it with "An invalid or
illegal string was specified", only reachable now that the callId fix
lets the handshake get this far). Split into the standard 3 steps:
deriveBits() for the raw ECDH shared secret, importKey('raw', ..., 'HKDF')
for the non-extractable HKDF base key, then deriveKey() with the actual
HKDF params to produce the AES-GCM key session.e2eeKey is used as.
callEncryptionKeys/callSecurityStatus were shallowRef<Map>, updated
everywhere via the pattern `const m = ref.value; m.set(...); ref.value = m`
— reassigning .value to the exact same Map reference. A shallowRef's
setter compares by reference (Object.is), so this is a no-op as far as
Vue's reactivity is concerned: nothing ever notified dependents, even
though the Map itself was correctly mutated.

The actual E2EE encryption was unaffected (setupMediaEncryption reads
session.e2eeKey directly, not through this ref), but CallOverlay.vue's
securityStatus computed — and therefore the badge — never re-evaluated,
so it stayed on "Chiffrement..." forever regardless of how the
handshake actually went. Confirmed by a console log showing the
handshake completing successfully while the badge stayed stuck.

Switched both to plain ref(), matching remoteStreams/activeCalls/
remoteSpeaking elsewhere in this same file — Vue's reactive Map wrapper
makes .set() itself trigger dependents, same pattern already relied on
for those.
Added getConnectionType() in useSecurePeer.ts, which inspects the real
RTCPeerConnection.getStats() output — the nominated ICE candidate pair
— rather than assuming from static config. PEER_CONFIG only declares
STUN servers (no TURN), so a successful connection is always direct,
but this confirms it from the actual negotiated path instead of just
that absence, and correctly reports 'relay' if a TURN server is ever
added later.

Surfaced in the SAS verification panel (CallOverlay.vue), fetched when
it opens: "Connexion directe entre vos deux appareils" in green, or a
yellow relay notice if it ever isn't.
Root cause: PeerJS's Negotiator never listens for the browser's
'negotiationneeded' event. Every call starts audio-only (startCall/
acceptCall), so turning on the camera or screen share for the first
time in a call always goes through pc.addTrack() on an existing
connection — which requires renegotiation to actually reach the other
side. Since nothing ever renegotiated, the track existed locally (the
sender existed) but no SDP describing it was ever exchanged, so the
peer's ontrack never fired. toggleScreenShare had it worse: it had no
addTrack fallback at all (only replaceTrack), so screen sharing before
ever having turned the camera on silently did nothing.

Fixed by driving renegotiation manually over the already-open
'secure-control' data channel (extended KeyExchangeMessage with
RENEGOTIATE_OFFER/RENEGOTIATE_ANSWER, reusing its existing timestamp/
callId replay protection) instead of PeerJS's own signaling — avoids
touching its internal Negotiator.

Also fixed: the screen-share track was only ever added to `screenStream`,
never to `localStream`, which is what the self-preview PiP actually
renders — so even when the remote side worked, your own screen share
never showed in your own preview. Screen sharing now also cleanly hands
back to the camera when it ends (if the camera was on beforehand),
instead of leaving a black frame.

Also: removed "E2EE non vérifié" wording (a manual, opt-in SAS check
that most people will never do shouldn't be a persistent alarming
label) and simplified "Appel sécurisé E2EE" to "Appel sécurisé" across
the call UI — the encryption itself is unconditional, no need to
expose the acronym on the always-visible surface.
No error/warning surfaced on the previous test of screen+camera share
not reaching the receiver, which leaves two very different possible
causes open: the manual renegotiation (added last session) never
actually completing, vs. it completing correctly but the UI failing to
render the arrived track. These logs pin down exactly where in the
chain it breaks: whether publishVideoTrack takes the replaceTrack or
addTrack+renegotiate branch, whether the offer/answer round-trip
completes on both sides (with signalingState and sender/receiver
counts at each step), and whether the receiving side's PeerJS 'stream'
event ever fires with a video track at all.
Confirmed by the diagnostic logs: signaling was never the problem —
the receiver's own log shows the renegotiated "stream" event firing
correctly with video tracks: 1. The break was purely on the Vue side.

When a track is added to an already-negotiated connection, the browser
hands back the exact same MediaStream object as before (same stream
id), mutated in place with the new track — it doesn't construct a new
one. Vue's reactive Map.set() only notifies dependents when a key is
new OR its value changed by reference (Object.is) for an existing key;
here the key (peerId) already existed and the value was the identical
object reference, so .set() was a silent no-op as far as Vue's
reactivity was concerned. hasRemoteVideo/currentRemoteStream in
CallOverlay.vue never re-evaluated, so the UI stayed on the avatar
view even though remoteStreams actually held the video track.

Fixed with an explicit triggerRef(remoteStreams) right after the
.set() call, forcing the notification Vue's own change-detection
couldn't catch. The local self-preview was never affected by this —
it binds directly to the live localStream MediaStream (no intermediate
computed to fail to re-run), which is why only the receiver's view was
broken.
triggerRef(remoteStreams) (previous commit) was necessary but not
sufficient. currentRemoteStream re-evaluates now, but its *result* is
still the exact same MediaStream object reference as before (the
browser mutates it in place rather than replacing it) — so Vue's
computed layer sees "recomputed to an unchanged value" and stops the
invalidation right there, never re-running hasRemoteVideo at all. This
is why the video stayed invisible even with the previous fix: the
receiver's own logs already proved the track was arriving correctly.

Replaced hasRemoteVideo's derivation with remoteHasVideo, a plain
ref<Map<string, boolean>> updated explicitly wherever the track state
actually changes (mirrors the already-working remoteSpeaking pattern).
Booleans compare by value, not reference, so this doesn't hit the same
short-circuit.

Also handled the reverse case while here: when the sender turns their
camera/share off, nothing renegotiates (the track just stops locally),
so no new 'stream' event would ever tell the receiver — listening for
the track's own 'ended' event closes that gap, otherwise the receiver
would get stuck on a frozen last frame forever after the sharer stops.
…on ICE timeout

PeerJS's MediaConnection.close() never signals the remote side at all
— it just tears down the local RTCPeerConnection. The other person's
UI only found out via their own ICE connection eventually reaching
'failed' state (PeerJS only reacts to 'failed'/'closed', not
'disconnected'), which can take a long, unpredictable amount of time
depending on the network, sometimes never resolving cleanly. So when
one side hung up, the other could be left looking connected — with the
call already dead — for a while.

endCall() now sends an explicit HANGUP message over the already-open
secure data channel before closing, and the receiving side responds by
closing its own MediaConnection immediately, which routes through the
same call.on('close') → removePeerFromCall cleanup already used for a
locally-initiated hangup. Falls back to the existing ICE-based
detection if the data channel isn't open for any reason.
…fix notification loop, add file sharing

Root causes found and fixed:

- Notification loop on accept: PrivateMeetView.vue::mount() always
  emitted privateMeet:call unconditionally, whether opened to *start*
  a session or to *accept* one (clicking "Répondre" just navigated,
  and mount() ran the same code either way). So accepting A's
  invitation made B re-emit privateMeet:call back at A — the backend
  (privateMeet.ts) relays every call as a fresh incomingCall with zero
  dedup, so A got a bogus second "incoming call" notification for a
  call they made themselves. Fixed by splitting the two paths:
  startMeet() (only from the "Session éphémère" button) emits call;
  acceptIncomingMeet() (only from "Répondre") emits the previously
  dead-code privateMeet:accept instead — the backend already handled
  it, the client just never sent it. "Refuser" now actually emits
  privateMeet:decline too, instead of just hiding the local card with
  no signal to the caller.
- No persistence: usePrivatMeet.ts held all its state inside the
  exported function (per component instance, not shared) and its own
  onUnmounted destroyed the PeerJS connection — so navigating away
  from the route killed the session outright. Moved to module-level
  singleton state (mirrors useSecurePeer.ts's existing pattern for
  calls), with initPeer() now called once from OrgLayout.vue instead
  of from the route component. PrivateMeetView.vue no longer owns the
  connection lifecycle, just observes the shared state — ending a
  session is now only an explicit action (hangup button, or the peer
  closing), never a side effect of unmounting.
- Return navigation: ChatView.vue now redirects from the normal DM
  route to the privateMeet route when there's an active session with
  that person (activeMeetPeerId), so reopening that person's
  conversation brings back the ephemeral session instead of showing
  the normal DM.
- Background message notifications: usePrivatMeet.ts's data handler
  checks whether the current route is this exact session before
  pushing a message; if not, notifies via a new notif:privateMeetMsg
  type — sender name/avatar only, never the message content (same
  rule already applied to DM/thread notifications this session).
- z-index: PrivateMeetView's overlay wrapper was z-50 while ChatView's
  own footer (still mounted underneath) was z-[110] — the normal
  chat's textarea rendered on top of the ephemeral one. Bumped to
  z-[150].
- P2P/E2EE hardening: usePrivatMeet.ts's initPeer() never passed a
  `config` to the PeerJS constructor, so it fell back to PeerJS's
  default ICE config — which includes a public TURN relay
  (turn.peerjs.com). Extracted the STUN-only PEER_CONFIG already used
  by useSecurePeer.ts into a shared assets/utils/peerConfig.ts so both
  P2P systems guarantee a direct connection the same way. Replaced the
  static, never-verified "Chiffré de bout en bout (P2P)" badge with a
  real check (mirrors useSecurePeer.ts's getConnectionType(), based on
  RTCPeerConnection.getStats()) that shows a relay warning if it's
  ever wrong. Message crypto itself (RSA-OAEP 4096 wrapping a
  per-message AES-GCM-256 key) was already correctly implemented —
  unlike the ECDH/HKDF bug found and fixed in useSecurePeer.ts earlier
  this session, no crypto bug here.
- File sharing: new encryptBufferForPeer/decryptBufferFromPeer in
  crypto.ts (same RSA+AES hybrid scheme as text messages, but on raw
  ArrayBuffer — no base64, PeerJS's binary serialization already
  chunks large payloads natively). sendEncryptedFile() in
  usePrivatMeet.ts, paperclip button + drag&drop in PrivateMeetView.vue,
  200MB client-side cap (everything transits and stays in memory, no
  streaming).

Known residual gap, not fixed here (flagged, out of the explicit ask):
unlike calls, there's no SAS/fingerprint verification of the initial
RSA public key exchange — a compromised signaling server could in
theory MITM it. Calls already have this via the security panel; adding
the equivalent here would be a follow-up if wanted.
sendEncryptedFile() used to do one opaque connection.send() with the
whole encrypted file, and the message bubble only appeared once that
call returned — for a large file, both sides had zero feedback for
however long the transfer actually took (PeerJS chunks large payloads
internally but exposes no progress event for it), which is exactly
what felt like "getting lost" with no sign anything was happening.

Now the file is chunked by us (64KB pieces of the already-encrypted
ciphertext) into an explicit FILE_META + FILE_CHUNK[] wire protocol
instead of one send(). This gives real progress on both ends:
- Sender: bubble appears immediately (before encryption even starts),
  updates its percentage after each chunk's send() promise resolves.
- Receiver: bubble appears on FILE_META (filename/size known upfront),
  fills in as FILE_CHUNK messages arrive, decrypts once the last one
  lands.
PrivateMeetView.vue shows a progress ring + percentage while
sending/receiving, and a distinct error bubble if decryption ever
fails (instead of just never showing anything).
initPeer()'s early-return guard only checks that a Peer *object*
exists, not that its 'open' event has already fired — and even a fresh
init doesn't await 'open' either. So myPeerId.value could still be ''
when startMeet()/acceptIncomingMeet() immediately called
connectToPeer() right after awaiting initPeer() — connectToPeer()
silently no-ops on its `!myId` guard in that case, with no retry
anywhere. The user was left stuck on the loading screen forever,
intermittently — exactly matching "parfois, je reste bloqué" — timing
dependent on how long the handshake to the PeerJS signaling server
happened to take at that moment. The pre-refactor code (before
initPeer() moved to run once in OrgLayout.vue) used to explicitly wait
for this; the move dropped that wait by accident.

Added ensurePeerReady() (initPeer() + wait for myPeerId to actually be
set, reusing the existing waitFor() utility) before every
connectToPeer() call, with a clean error+reset instead of hanging if
it times out. Also added a 15s safety-net timeout to
acceptIncomingMeet() itself, mirroring the one startMeet() already had
— previously nothing caught the case where dialing succeeds but the
P2P connection itself never actually opens.
MisterPapaye and others added 16 commits September 19, 2026 17:15
…ld button

- Added a FILE_RECEIVED ack: the receiver only confirms once it has
  fully decrypted the file, not just received the last chunk — the
  sender's status:'done' only ever meant "finished sending", with no
  way to tell whether the peer actually got and decrypted it. New
  confirmedReceived flag + hasPendingFileTransfer (true while any file
  is sending/receiving, or sent-by-me but not yet peer-confirmed).
- PrivateMeetView.vue's hangup button now goes through requestClose(),
  which shows a ConfirmDelete prompt (never a native confirm()) instead
  of silently cutting the connection when hasPendingFileTransfer is
  true — closing early would otherwise cut a transfer that isn't
  actually finished on the receiving end.
- Replaced the large "Chiffré de bout en bout (P2P)" header pill with
  a small shield icon button (still colored green/yellow to reflect
  live connection type at a glance) that opens a Popup explaining how
  the P2P E2EE actually works for these sessions — connection type,
  the RSA+AES handshake, that nothing is ever stored, and an honest
  note on the known gap (no SAS verification of the initial key
  exchange, unlike calls).
… calls

usePrivatMeet.ts and useSecurePeer.ts (calls) both registered a PeerJS Peer
on the same signaling server using the same OrgMember.id, since OrgLayout.vue
now initializes both at org-session start — two Peer objects fighting over
one id caused the open/close loop ("Établissement du canal sécurisé" stuck
retrying). Give the ephemeral-session peer its own namespaced id (-meet
suffix), isolated from calls.

Also: revoke file Blob URLs and clear incomplete transfers on session end
(messages.value = [] alone didn't release the underlying Blob memory),
remove the "Limite connue" section from the encryption info popup, and add
a close button to the "no active session" empty state (previously a dead
end since the header housing the back button only renders during an active
session).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ion ding

Incoming/outgoing DM calls already played the looping callSound.wav
(useSecurePeer.ts), but Notifications.vue's generic watcher additionally
played the short notification.mp3 "ding" for every non-toast notification,
including notif:call — so a ringing call was accompanied by a one-shot ding
on top of the loop. Ephemeral (privateMeet) sessions had no ringtone at all,
only that same ding, on both the caller side (waiting for answer) and the
callee side (incoming invitation).

- usePrivatMeet.ts: add a dedicated looping ringtone (same callSound.wav,
  separate Audio instance so it can't collide with a concurrent DM call),
  started in startMeet() (caller, while waiting for a response) and exposed
  as startRingtone() for OrgLayout.vue to trigger on incoming invitations;
  stopped on connection open, decline/timeout/hangup (endMeet), and
  immediately when accepting or declining.
- OrgLayout.vue: start the ephemeral-session ringtone as soon as
  privateMeet:incomingCall arrives, alongside the existing notif:privateMeet
  card.
- Notifications.vue: skip the generic ding for notif:call and
  notif:privateMeet (both already have their own looping sound) while
  keeping it for plain message notifications.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…xisted

'/callSound.wav' was never actually present in public/ (checked: no file,
no git history at that path) — new Audio('/callSound.wav').play() has
always been rejecting silently (swallowed by .catch(() => {})), so the
looping call ringtone has never actually made sound in either useSecurePeer.ts
(DM calls) or the ephemeral-session ringtone just added to usePrivatMeet.ts.
What was audible before was only the generic notification ding (now
correctly skipped for notif:call/notif:privateMeet), which is why disabling
it surfaced as "no sound at all" instead of "now it's the right sound".

Point both at public/sounds/call_incoming.mp3, the only ringtone-shaped file
that actually exists on disk.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…issed-call/session notifications

Caller cancels before pickup:
- DM calls already stopped the ringtone on cancel (call.on('close') in
  handleIncomingCall) but rejectCall() closed the MediaConnection BEFORE
  nulling enteringCall.value — if PeerJS emits 'close' synchronously, the
  guard in that same handler couldn't tell an explicit refusal from a
  caller-side cancel. Reordered so the guard is reliable.
- privateMeet had no cancel signal at all: connectToPeer() happens
  independently of the call/accept/decline socket signaling, so a caller
  hanging up before the callee responds left the "incoming invitation" card
  stuck forever and the callee's own state unresolved. Added
  privateMeet:cancel/cancelled (backend relay, mirrors accept/decline) —
  emitted by endMeet() whenever a session ends before ever connecting.
  usePrivatMeet.ts is split into cleanupMeetState() (local-only, used by
  handlers reacting to a remote signal) and endMeet() (notifies the other
  side first) to avoid an infinite decline/cancel ping-pong.

Missed call/session notifications:
- New notif:missedCall / notif:missedMeet types (useNotifications.ts,
  Notifications.vue) — left behind once the ringing card disappears, same
  transient/dismissible pattern as message notifications, name+avatar only.
- useSecurePeer.ts pushes notif:missedCall from the same close handler that
  already tears down an unanswered incoming call.
- OrgLayout.vue pushes notif:missedMeet on privateMeet:cancelled, after
  removing the stale notif:privateMeet card for that caller.
- useNotifications.ts: notification ids switched from `array.length + 1`
  (collision-prone once items are removed) to a monotonic counter, and
  notify() now returns the created id — needed for this removal to
  reliably target the right card.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… timeout

Two related bugs: cancelling an outgoing DM call before the callee answers
left their "incoming call" card and ringtone stuck forever (PeerJS's
MediaConnection.close() only emits 'close' locally — checked in its source,
it sends nothing over the wire, and before answering the callee doesn't
even have a negotiator/data channel yet for any signal to reach them
through anyway); and an unanswered call had no timeout at all, so both
sides could ring indefinitely with no way to resolve except a manual hangup.

- New call:cancel/call:cancelled socket relay (backend, mirrors
  privateMeet:cancel) as the only reliable channel before pickup.
- SecureCallSession gains `answered` (set on the 'stream' event) to tell an
  established call from one still ringing.
- endCall() emits call:cancel for any session that was never answered, in
  addition to the existing HANGUP/close() path for answered ones.
- startCall() now gives up automatically after 30s of no answer
  (CALL_RING_TIMEOUT), calling endCall() — this also naturally fixes the
  "rings forever" case even if the caller never manually hangs up.
- Extracted dismissMissedIncomingCall() (was inline in the call.on('close')
  handler) so both that path and the new call:cancelled listener share the
  same cleanup + missed-call notification logic.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
TodosCard.vue already tracked "new or updated" tasks (isNewOrUpdated) for
the visual pill/highlight, but sorting ignored it entirely, giving equal
footing to a just-reassigned task and one nobody's touched in weeks. Now
those come first, then the rest ordered by closest deadline, then the
least urgent (no due date) last — same due-date/recency rule applied to
both groups via the extracted sortByDueThenRecency() helper.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ls/sessions/workspace adds

Renamed PendingMessagesCard.vue -> NotificationsCard.vue (header text
"Messages" -> "Notifications", icon chat->bell) and broadened it beyond
unread DMs/thread messages to also show, ungrouped, the three new
persisted notification types added server-side this session:
MISSED_CALL, MISSED_MEET, WORKSPACE_ADDED. Each renders with a small
badge icon (red phone/shield for missed call/session, primary "+" for a
workspace add) over the sender's avatar, and clicking marks it read and
navigates via the route the backend already resolved (no local
DM/thread-id reconstruction needed for these, unlike the existing
grouped items).

NotificationType (types.ts) and getToastType (useNotification.ts)
extended to match the backend enum.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ads it

Root cause: initListener()'s 'connect' handler in both ThreadView.vue and
ChatView.vue unconditionally called joinThread()/joinDM() on EVERY 'connect'
event — including every reconnect, not just the first connection. socket.io
is configured with reconnection:true/reconnectionAttempts:Infinity
(useWSocket.ts), so 'connect' fires again after any network blip, tab/device
sleep-wake, or server restart. joinThread()/joinDM() unconditionally reset
loading=true, cleared the message list/thread key, then forced an instant
scroll-to-bottom once history came back — a full visible reload each time,
even though nothing had actually changed and the user might have been
scrolled up reading history.

Both now take a `silent` flag, set when the reconnect targets the thread/DM
already loaded (tracked via joinedThreadId/joinedDMUserId, set on the prior
successful load). A silent rejoin still re-emits join-thread/join-dm and
refreshes the message list in place (so genuinely missed updates while
disconnected still arrive) but skips the loading flag, the key/list reset,
the forced scroll-to-bottom, and — for threads — stealing textarea focus.
A defensive reset of the pending-silent flag on every non-silent join
guards against it leaking into an unrelated later reconnect.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Matches the wording already used elsewhere for the same concept (e.g.
TodosCard.vue's task.space?.name || 'Perso' fallback).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…g filters

TaskProgressGauge was fed a different, less-filtered task source than the
Kanban columns in both task views:

- TasksGlobal.vue passed it raw myTasks (every space, every tag) while the
  columns went through filteredTasks(), which additionally applied
  filterTagIds and filterSpaceId — so picking a workspace or a tag changed
  the board but never moved the gauge.
- TasksSpace.vue's gauge only replicated the member filter inline and
  never applied filterTagIds at all — so filtering by tag was silently
  ignored by the gauge (only the member filter happened to line up).

Extracted a shared `visibleTasks` computed in each view (all active
filters, no status filter) that both the gauge and filteredQtasks(status)
now read from, so they can no longer drift apart.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Three click-to-delete entry points deleted immediately with no
confirmation (violates the project rule: no destructive action without
ConfirmDelete.vue, never a native confirm()):
- TasksGlobal.vue / TasksSpace.vue: the task card's dropdown "Supprimer".
- TaskDetailsModal.vue: the "Supprimer la tâche" footer button.

Each now opens a ConfirmDelete dialog naming the task before calling the
DELETE endpoint. The drag-to-trash gesture (onDropToTrash, both task
views) is untouched — it's a separate function with its own deliberate
multi-step interaction, not the "click delete" flow being fixed here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- useNotifications.ts: n.call?.id is string|undefined, Set<string>.has()
  needs string — guard the undefined case explicitly instead of passing
  it through (same runtime result: a Set<string> never matches undefined
  anyway).
- OrgLayout.vue space:updated handler: indexed access on spaces![index]
  stays possibly-undefined to the type checker even after the earlier
  index === -1 guard (no control-flow narrowing across that) — asserted
  non-null to match this array's existing !-heavy style.
- OrgLayout.vue notif:dm:new-message handler: DMMessage.createdAt is
  typed string | Date (covers optimistic local messages using `new
  Date()`) but recordDMInteraction() takes a plain string — normalize to
  an ISO string at the call site rather than widening the composable's
  signature for one caller.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@m335671
m335671 merged commit 32f4968 into main Sep 19, 2026
1 check passed
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.

2 participants