From 4a823e316e7b85e989ab8ff166c86798627b987b Mon Sep 17 00:00:00 2001 From: m335671 Date: Sat, 19 Sep 2026 01:21:32 +0200 Subject: [PATCH 01/43] fix(ci): make local act testing of release_main.yml reliable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .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 Claude-Session: https://claude.ai/code/session_011MfVvAw1QC9scoKQMRyj3u --- .gitattributes | 5 +++++ .github/workflows/local/release_main.yml | 16 ++++++++++++++-- ios/App/CapApp-SPM/Package.swift | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index dfe07704..5208f5ea 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,7 @@ # Auto detect text files and perform LF normalization * text=auto + +# Templates/scripts Linux : toujours LF, même sur un checkout Windows (sinon les fichiers générés +# depuis ces templates héritent de CRLF, ce qui casse le parsing strict de certains outils Linux, +# ex: Icon=app\r dans un .desktop qui ne matche plus jamais un fichier app.png). +src-tauri/linux/** text eol=lf diff --git a/.github/workflows/local/release_main.yml b/.github/workflows/local/release_main.yml index 239d69ff..c47a08d0 100644 --- a/.github/workflows/local/release_main.yml +++ b/.github/workflows/local/release_main.yml @@ -66,6 +66,12 @@ jobs: build-windows-msi: name: Build de l'installeur Windows (MSI) + # Enchaîné après build-android-apk (au lieu de tourner en parallèle) : sous `act` sur Windows, les + # jobs concurrents partagent le même checkout/dossier de travail réel (contrairement au vrai CI + # GitHub où chaque job a sa propre VM isolée), ce qui a corrompu .env/.env.production pendant un + # build simultané (VITE_API_URL embarqué en "http://localhost:9000" au lieu de la vraie valeur). + # Un seul `act push` reste possible, l'exécution est juste séquentielle au lieu de parallèle. + needs: build-android-apk runs-on: windows-latest steps: - name: Checkout du code @@ -96,6 +102,7 @@ jobs: build-linux-appimage: name: Build de l'AppImage Linux + needs: build-windows-msi # voir commentaire sur build-windows-msi : exécution séquentielle voulue sous act runs-on: ubuntu-latest steps: - name: Checkout du code @@ -118,6 +125,7 @@ jobs: gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ gstreamer1.0-plugins-bad gstreamer1.0-libav \ xdg-utils shared-mime-info + sudo apt-get install -y libfuse2t64 || sudo apt-get install -y libfuse2 # linuxdeploy (AppImage) est lié à l'ABI fuse2, absente par défaut sur ubuntu-24.04+ - name: Génération des fichiers .env run: | @@ -130,7 +138,10 @@ jobs: - name: Build de l'AppImage env: NODE_OPTIONS: --max-old-space-size=6144 - APPIMAGE_EXTRACT_AND_RUN: "1" # linuxdeploy a besoin de FUSE, absent des runners/conteneurs ubuntu-24.04+ + # Pas de APPIMAGE_EXTRACT_AND_RUN ici (contrairement au vrai CI) : sous act/Docker, ce mode + # provoque une race condition sur le plugin gtk (le dossier d'extraction temporaire de + # linuxdeploy est nettoyé avant que le plugin ne s'exécute -> "exit code 127"). En local on + # utilise du vrai FUSE à la place, via `act --privileged` (ou --container-options "--privileged"). NO_STRIP: "true" # le strip des binutils récents (ubuntu-24.04+) plante sur la section .relr.dyn de certaines libs (cf tauri-apps/tauri#15106) run: bun run tauri:build -- --bundles appimage @@ -156,6 +167,7 @@ jobs: build-docker-image: name: Build et push de l'image Docker (front, prod) + needs: build-linux-appimage # voir commentaire sur build-windows-msi : exécution séquentielle voulue sous act runs-on: ubuntu-latest permissions: contents: read @@ -198,7 +210,7 @@ jobs: create-release: name: Création de la release GitHub - needs: [ build-android-apk, build-windows-msi, build-linux-appimage ] + needs: [ build-android-apk, build-windows-msi, build-linux-appimage, build-docker-image ] runs-on: ubuntu-latest steps: - name: Téléchargement des artefacts diff --git a/ios/App/CapApp-SPM/Package.swift b/ios/App/CapApp-SPM/Package.swift index c7e5b810..2f5acfc4 100644 --- a/ios/App/CapApp-SPM/Package.swift +++ b/ios/App/CapApp-SPM/Package.swift @@ -11,7 +11,7 @@ let package = Package( targets: ["CapApp-SPM"]) ], dependencies: [ - .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.4.2"), + .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.5.0"), .package(name: "CapacitorApp", path: "..\..\..\node_modules\@capacitor\app"), .package(name: "CapacitorBrowser", path: "..\..\..\node_modules\@capacitor\browser") ], From 8882a3f65a36d35eb585f8835df52b85195a4897 Mon Sep 17 00:00:00 2001 From: m335 <110462702+m335671@users.noreply.github.com> Date: Sat, 19 Sep 2026 11:16:39 +0200 Subject: [PATCH 02/43] fix(tauri): sanitize env before opening the OAuth browser from the AppImage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src-tauri/src/lib.rs | 55 +++++++++++++++++++++++++++++++++++++++++- src/assets/keycloak.ts | 4 +-- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a1236565..8505e03e 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1,5 +1,58 @@ use tauri::{Emitter, Manager}; +// L'AppImage (linuxdeploy) exporte LD_LIBRARY_PATH/GTK_PATH/GIO_EXTRA_MODULES/... pour pointer +// vers ses libs embarquées. Un sous-processus qui hérite de cet environnement (ex: le navigateur +// lancé via xdg-open pour le login OAuth) essaie de charger ces libs au lieu de celles du système +// et plante sur un mismatch de version (ex Firefox: "XPCOMGlueLoad error ... libnss3.so: version +// `NSS_3.126' not found"), donc le navigateur ne s'ouvre jamais. On les retire avant de spawn. +#[cfg(target_os = "linux")] +const APPIMAGE_POLLUTED_ENV_VARS: &[&str] = &[ + "LD_LIBRARY_PATH", + "GTK_PATH", + "GIO_EXTRA_MODULES", + "GDK_PIXBUF_MODULE_FILE", + "GSETTINGS_SCHEMA_DIR", + "GST_PLUGIN_SYSTEM_PATH_1_0", + "GST_PLUGIN_PATH_1_0", + "GST_PLUGIN_SCANNER_1_0", + "GST_PLUGIN_SYSTEM_PATH", + "GST_PTP_HELPER_1_0", + "GST_REGISTRY_REUSE_PLUGIN_SCANNER", +]; + +#[tauri::command] +fn open_external_url(url: String) -> Result<(), String> { + #[cfg(target_os = "linux")] + { + let mut cmd = std::process::Command::new("xdg-open"); + cmd.arg(&url); + for var in APPIMAGE_POLLUTED_ENV_VARS { + cmd.env_remove(var); + } + return cmd.spawn().map(|_| ()).map_err(|e| e.to_string()); + } + #[cfg(target_os = "macos")] + { + return std::process::Command::new("open") + .arg(&url) + .spawn() + .map(|_| ()) + .map_err(|e| e.to_string()); + } + #[cfg(target_os = "windows")] + { + return std::process::Command::new("cmd") + .args(["/C", "start", "", &url]) + .spawn() + .map(|_| ()) + .map_err(|e| e.to_string()); + } + #[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows")))] + { + Err("open_external_url is not supported on this platform".into()) + } +} + #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() @@ -13,7 +66,7 @@ pub fn run() { .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_deep_link::init()) .plugin(tauri_plugin_notification::init()) - .invoke_handler(tauri::generate_handler![]) + .invoke_handler(tauri::generate_handler![open_external_url]) .setup(|app| { if cfg!(debug_assertions) { app.handle().plugin( diff --git a/src/assets/keycloak.ts b/src/assets/keycloak.ts index 4cccc281..b8421fdf 100644 --- a/src/assets/keycloak.ts +++ b/src/assets/keycloak.ts @@ -3,9 +3,9 @@ import { kcToken } from "./var"; import { Capacitor } from "@capacitor/core"; import { Browser } from "@capacitor/browser"; import { App as CapApp, type URLOpenListenerEvent } from "@capacitor/app"; -import { open } from '@tauri-apps/plugin-shell'; import { onOpenUrl } from '@tauri-apps/plugin-deep-link'; import { listen } from '@tauri-apps/api/event'; +import { invoke } from '@tauri-apps/api/core'; const KC_URL = import.meta.env.VITE_KEYCLOAK_URL || 'http://localhost:8080/auth'; const KC_REALM = import.meta.env.VITE_KEYCLOAK_REALM || 'SilverTeams'; @@ -145,7 +145,7 @@ async function tauriLogin(): Promise<{ token?: string; refreshToken?: string }> + `&response_type=code&scope=openid&state=${state}` + `&code_challenge=${codeChallenge}&code_challenge_method=S256`; - await open(authUrl); + await invoke('open_external_url', { url: authUrl }); const callbackUrl = await deepLinkArrived; unlistenSingleInstance(); From f4ebdacd547b54f02da3256de23bf14a22078777 Mon Sep 17 00:00:00 2001 From: m335 <110462702+m335671@users.noreply.github.com> Date: Sat, 19 Sep 2026 11:16:47 +0200 Subject: [PATCH 03/43] fix(ci): drop bundled GStreamer MIDI plugin causing AppImage segfault MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/release_main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_main.yml index d862dc96..416c948b 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_main.yml @@ -127,13 +127,18 @@ jobs: NODE_OPTIONS: --max-old-space-size=6144 run: bun run tauri:build -- --bundles appimage - - name: Retrait de libwayland-client bundlée (EGL_BAD_PARAMETER sur Mesa 25+, cf tauri-apps/tauri#15665) + - name: Retrait de libs bundlées problématiques (EGL_BAD_PARAMETER sur Mesa 25+ cf tauri-apps/tauri#15665, segfault GStreamer/JACK) run: | cd src-tauri/target/release/bundle/appimage APPIMAGE=$(ls *.AppImage) chmod +x "$APPIMAGE" ./"$APPIMAGE" --appimage-extract rm -f squashfs-root/usr/lib/libwayland-client.so.0 + # libgstfluidsynthmidi.so (rendu MIDI, inutilisé par l'app) dépend de la couche de + # compat JACK de pipewire ; sur certaines distros la version système de pipewire n'a + # pas le symbole attendu (pw_log_topic_register), ce qui fait planter (SIGSEGV) le + # scan des plugins GStreamer au lancement, avant même d'afficher une fenêtre. + rm -f squashfs-root/usr/lib/gstreamer-1.0/libgstfluidsynthmidi.so curl -sL -o appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x appimagetool ./appimagetool --appimage-extract-and-run squashfs-root "$APPIMAGE" From b660a8f92696c7451669947b97926739bf131b14 Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Sat, 19 Sep 2026 11:25:56 +0200 Subject: [PATCH 04/43] perf(dm): stop recomputing the DM contact list from scratch every time it opens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/composables/useRecentDMs.ts | 60 +++++++++++++++++++ src/views/OrgSpace/OrgLayout.vue | 10 +++- .../components/layouts/ThreadsBar.vue | 55 ++++------------- src/views/OrgSpace/views/ChatView.vue | 18 ++++-- 4 files changed, 93 insertions(+), 50 deletions(-) create mode 100644 src/composables/useRecentDMs.ts diff --git a/src/composables/useRecentDMs.ts b/src/composables/useRecentDMs.ts new file mode 100644 index 00000000..a135c89e --- /dev/null +++ b/src/composables/useRecentDMs.ts @@ -0,0 +1,60 @@ +import { ref } from 'vue'; +import sfetch from '@/assets/utils/sfetch'; + +export interface RecentDM { + userId: string; + lastInteraction: string; +} + +// État module-level (partagé entre tous les appelants) plutôt que local à un +// composant : ThreadsBar.vue se démonte/remonte à chaque navigation vers/depuis +// Tasks/Agenda/Home (cf. OrgLayout.vue), et refaire l'appel réseau à chaque +// fois causait le délai visible + le "saut" de tri que l'utilisateur signalait +// ("ça recalcule à chaque ouverture"). Chargé une seule fois par session, +// tenu à jour ensuite par recordDMInteraction() (appelé depuis le listener +// socket persistant d'OrgLayout.vue, jamais démonté). +const recentDMUsers = ref([]); +const loaded = ref(false); +let loadingPromise: Promise | null = null; + +async function fetchRecentDMs(): Promise { + if (loaded.value) return; + if (loadingPromise) return loadingPromise; + + loadingPromise = (async () => { + try { + const res = await sfetch('/api/users/me/dms/recent'); + if (res.ok) { + recentDMUsers.value = await res.json(); + } + loaded.value = true; + } catch (e) { + console.error('[useRecentDMs] Échec du chargement des DM récents:', e); + } finally { + loadingPromise = null; + } + })(); + + return loadingPromise; +} + +function recordDMInteraction(peerId: string, timestamp: string) { + const existing = recentDMUsers.value.find(r => r.userId === peerId); + if (existing) { + existing.lastInteraction = timestamp; + } else { + recentDMUsers.value.push({ userId: peerId, lastInteraction: timestamp }); + } +} + +/** Id du dernier utilisateur avec qui une conversation a eu lieu, ou null si aucune. */ +function getMostRecentDMUserId(): string | null { + if (recentDMUsers.value.length === 0) return null; + return [...recentDMUsers.value].sort( + (a, b) => new Date(b.lastInteraction).getTime() - new Date(a.lastInteraction).getTime() + )[0]!.userId; +} + +export function useRecentDMs() { + return { recentDMUsers, loaded, fetchRecentDMs, recordDMInteraction, getMostRecentDMUserId }; +} diff --git a/src/views/OrgSpace/OrgLayout.vue b/src/views/OrgSpace/OrgLayout.vue index 9ae32981..a422445e 100644 --- a/src/views/OrgSpace/OrgLayout.vue +++ b/src/views/OrgSpace/OrgLayout.vue @@ -15,6 +15,7 @@ import { useUsersBar } from '@/composables/useUsersBar'; import { keycloak } from '@/assets/keycloak'; import useNotifications from '@/composables/useNotifications'; import { useNotification } from '@/composables/useNotification'; +import { useRecentDMs } from '@/composables/useRecentDMs'; import { isMeeting } from '@/composables/usePrivatMeet'; import isDesktopApp from '@/assets/isDesktopApp'; @@ -34,6 +35,7 @@ const { showUsersBar, setUsersBarHiddenByRoute } = useUsersBar(); const { initPeer } = useSecurePeer(); const { notify } = useNotifications(); const { init: initNotifications } = useNotification(); +const { fetchRecentDMs, recordDMInteraction } = useRecentDMs(); const route = useRoute(); const toast = useToast(); const { fetchPermissions } = usePermissions(computed(() => props.orgId)); @@ -450,6 +452,11 @@ const initSocketListener = async () => { const isMeTheSender = newMessage.senderId === user.value?.id; const conversationPeerId = isMeTheSender ? newMessage.recipientId : newMessage.senderId; + // Tient le cache partagé "DM récents" à jour même si ThreadsBar est + // démonté (Tasks/Agenda/Home) — ce listener est le seul persistant + // pour toute la durée de vie de l'org. + recordDMInteraction(conversationPeerId, newMessage.createdAt); + const peerMemberId = openedOrg.value?.members?.find(m => m.user?.id === conversationPeerId)?.id; const isCurrentConversation = (route.name === 'OrgThreadChat' || route.name === 'OrgThreadChatPrivateMeet') && route.params.userId === peerMemberId; @@ -593,7 +600,8 @@ onMounted(async () => { fetchPermissions(), initSocketListener(), initPeer(), - initNotifications() + initNotifications(), + fetchRecentDMs() ]) handleTabletChange(mediaQuery); diff --git a/src/views/OrgSpace/components/layouts/ThreadsBar.vue b/src/views/OrgSpace/components/layouts/ThreadsBar.vue index 4bb0f442..51479591 100644 --- a/src/views/OrgSpace/components/layouts/ThreadsBar.vue +++ b/src/views/OrgSpace/components/layouts/ThreadsBar.vue @@ -359,10 +359,10 @@ \ No newline at end of file From 1f66174e09b3b50a3c9319f1da5d72540a342937 Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Sat, 19 Sep 2026 11:29:49 +0200 Subject: [PATCH 06/43] fix(theme): use the light-theme banner on the PIN unlock and login screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /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 --- src/App.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index f6fa883b..142fe372 100644 --- a/src/App.vue +++ b/src/App.vue @@ -396,7 +396,7 @@ onMounted(async () => {
- Logo + Logo

@@ -494,7 +494,7 @@ onMounted(async () => {
- Logo + Logo
From 2a2a9d49e82dc5dbdde4a316c747e912e5228498 Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Sat, 19 Sep 2026 11:32:17 +0200 Subject: [PATCH 07/43] fix(dm): silence "Extraneous non-props attributes" warning on ChatMessage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/views/OrgSpace/components/common/ChatMessage.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/views/OrgSpace/components/common/ChatMessage.vue b/src/views/OrgSpace/components/common/ChatMessage.vue index 8f79a2bb..87401c4d 100644 --- a/src/views/OrgSpace/components/common/ChatMessage.vue +++ b/src/views/OrgSpace/components/common/ChatMessage.vue @@ -1,7 +1,8 @@