From 87754d2df209f254531b1a7020d72650aae66a6d Mon Sep 17 00:00:00 2001 From: le king fu Date: Fri, 23 Oct 2026 20:30:01 -0400 Subject: [PATCH 1/6] fix(db): keep no folder holding ;, |, a backtick or ) in Journal lines (#478) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit withoutFolders ended a path at a backtick, `;`, `|` or a `)` not followed by a separator, so a folder name that holds one of them stayed in the Journal line, or its start did: `C:\Users\Jean (Work) Smith\AppData\x.db` gave `Jean (Work) x.db`, `C:\Users\jean\My;Docs\x.db` gave `My;Docs-x.db`. An error line of the Journal can go with a feedback report. PATH_STOP is reduced to a line break and a double quote, and the `)` branch of lastSeparator is gone (option B, Max's decision of 2026-10-20). A path now runs to its last separator before a line break, a double quote, a `,` or `:` followed by a blank, or a blank followed by another path. The conservative rule pays for it: `/a/x.db; I/O` gives `O` and `(see /a/x.db) and I/O` gives `(see O`, pinned by the test « drops more text rather than a folder ». Co-Authored-By: Claude Opus 5.5 --- src/services/db.test.ts | 52 ++++++++++++++++++++++++++++++++++++----- src/services/db.ts | 34 ++++++++++++++++----------- 2 files changed, 66 insertions(+), 20 deletions(-) diff --git a/src/services/db.test.ts b/src/services/db.test.ts index 1ec3e4e..4a66a17 100644 --- a/src/services/db.test.ts +++ b/src/services/db.test.ts @@ -700,6 +700,21 @@ describe("describePreparation (#390)", () => { } }); + it("writes no folder that holds a `)` followed by a word or a `;` in an error line (#478)", () => { + const lines = describePreparation( + "x.db", + report({ + // A path scrub did not replace, under a user folder `Jean (Work) Smith`. + catch_up_error: + "backup_failed: unable to open database: C:\\Users\\Jean (Work) Smith\\AppData\\Roaming\\com.simpl.resultat\\migration-backups\\x-before-v17.db.tmp", + catch_up_backup: "C:\\Users\\jean\\My;Docs\\x-before-v17.db", + }) + ); + expect(lines.errors).toEqual([ + "Profile x.db: database update stopped: backup_failed: unable to open database: x-before-v17.db.tmp; copy of the previous state kept as x-before-v17.db", + ]); + }); + it("withoutFolders keeps text without a path as is", () => { expect(withoutFolders("migration_failed:v12: near \"x\": syntax error")).toBe( 'migration_failed:v12: near "x": syntax error' @@ -718,7 +733,8 @@ describe("describePreparation (#390)", () => { ["\\\\server\\share\\Jean Dupont\\x.db", "x.db"], ["C:\\Program Files (x86)\\Simpl\\x.db", "x.db"], ['"C:\\Users\\Jean Dupont\\x.db" failed', '"x.db" failed'], - ["(see /home/marie claire/x.db) and I/O", "(see x.db) and I-O"], + // A `)` no longer ends a path: the cut goes to the `/` of `I/O` (#478). + ["(see /home/marie claire/x.db) and I/O", "(see O"], ["path=/home/marie claire/x.db;next", "path=x.db;next"], ])("withoutFolders reduces %s to its last segment", (input, expected) => { const cleaned = withoutFolders(input); @@ -726,6 +742,21 @@ describe("describePreparation (#390)", () => { expect(cleaned).not.toMatch(/Jean|Dupont|marie|claire|Users|home|Program|server/); }); + // A folder name may hold `;`, `|`, a backtick, or a `)` followed by a word: + // none of them ends a path, so no word of that folder stays (#478). + it.each([ + ["C:\\Users\\Jean (Work) Smith\\AppData\\x.db", "x.db"], + ["C:\\Users\\jean\\My;Docs\\x.db", "x.db"], + ["C:\\Users\\jean\\My|Docs\\x.db", "x.db"], + ["C:\\Users\\jean\\My`Docs\\x.db", "x.db"], + ["unable to open C:\\Users\\Jean (Work) Smith\\AppData\\x.db: disk I/O error", "unable to open x.db: disk I-O error"], + ["/home/jean (work)/x.db", "x.db"], + ])("withoutFolders keeps no word of a folder that holds a former stop: %s (#478)", (input, expected) => { + const cleaned = withoutFolders(input); + expect(cleaned).toBe(expected); + expect(cleaned).not.toMatch(/Users|Jean|jean|Work|work|Smith|AppData|My|Docs|home/); + }); + it("withoutFolders ends a path at sentence punctuation and at the next path", () => { expect(withoutFolders("unable to open /home/marie claire/x.db: disk I/O error")).toBe( "unable to open x.db: disk I-O error" @@ -734,9 +765,13 @@ describe("describePreparation (#390)", () => { "read a.db, then b.db" ); expect(withoutFolders("'C:\\a\\b.db' and 'C:\\Users\\Jean Dupont\\d.db'")).toBe("'b.db' and 'd.db'"); + // Past a `)`, the next path still ends the previous one (#478). + expect(withoutFolders("(see /home/marie claire/a.db) and C:\\Users\\Jean Dupont\\b.db")).toBe( + "(see a.db) and b.db" + ); }); - it.each([["\""], [";"], ["|"], ["`"], ["\n"], ["\r"]])("withoutFolders ends the folders at %j", (stop) => { + it.each([["\""], ["\n"], ["\r"]])("withoutFolders ends the folders at %j", (stop) => { expect(withoutFolders(`/home/marie claire/x.db${stop} I/O`)).toBe(`x.db${stop} I-O`); }); @@ -745,8 +780,13 @@ describe("describePreparation (#390)", () => { expect(withoutFolders("cannot open '/home/marie claire/x.db' now")).toBe("cannot open 'x.db' now"); }); - it("withoutFolders drops more text rather than a folder when nothing ends the path", () => { - // Conservative: everything up to the last separator of the line goes. - expect(withoutFolders("/home/marie claire/x.db then I/O")).toBe("O"); - }); + // Conservative: everything up to the last separator of the line goes. `;`, + // `|`, a backtick and `)` may sit in a folder name, so they end nothing + // either, and a suffix after them that holds a separator goes too (#478). + it.each([[" then"], [";"], ["|"], ["`"], [")"]])( + "withoutFolders drops more text rather than a folder when nothing ends the path, after %j", + (after) => { + expect(withoutFolders(`/home/marie claire/x.db${after} I/O`)).toBe("O"); + } + ); }); diff --git a/src/services/db.ts b/src/services/db.ts index 816a272..3ea9346 100644 --- a/src/services/db.ts +++ b/src/services/db.ts @@ -328,8 +328,12 @@ export interface ProfilePreparation { */ const PATH_START = /[\\/]|[A-Za-z]:[\\/]|~[\\/]|\.{1,2}[\\/]|[\\/]/y; const BEFORE_START = /[\s'"`(=:,[]/; -/** What ends the folders of a path for sure: a line break, a double quote or a backtick, `;`, `|`. */ -const PATH_STOP = /[\n\r"`;|]/; +/** + * What ends the folders of a path for sure: a line break or a double quote, + * which Windows forbids in a name and no real folder holds elsewhere. A + * backtick, `;` and `|` can sit in a folder name, so they end nothing (#478). + */ +const PATH_STOP = /[\n\r"]/; /** The last segment of a path: the file name, kept. */ const LAST_SEGMENT = /[^\s"`()<>\\/]*/y; /** @@ -367,8 +371,8 @@ function lastSeparator(text: string, from: number): number { if (PATH_STOP.test(c)) break; // Sentence punctuation: Windows forbids `:` in a name, and no user name holds `,`. if ((c === "," || c === ":") && (next === "" || /\s/.test(next))) break; - // `Program Files (x86)\…` goes on; `(see /x/y.db) and…` stops. - if (c === ")" && next !== "\\" && next !== "/") break; + // No `)` stop: `Jean (Work) Smith\…` is a folder name as much as + // `Program Files (x86)\…` (#478). if (/\s/.test(c) && newPathAfter(text, k)) break; } return last; @@ -378,16 +382,18 @@ function lastSeparator(text: string, from: number): number { * Keep only the last segment of every path in `text`: error lines can be * attached to a feedback report, and a folder holds the OS user name * (Loi 25). A folder may contain blanks (`C:\Users\Jean Dupont\…`, - * `/home/marie claire/…`): from its start, a path runs to its LAST separator - * before a line break, a double quote, a backtick, `;`, `|`, a `,` or `:` - * followed by a blank, a closing parenthesis not followed by a separator, or a - * blank followed by another path. When nothing ends it, the rule is - * conservative: text after a path is dropped up to the last separator of the - * line (`/a/x.db then I/O` gives `O`), rather than letting a folder through. - * Limits in ADR 0021, section 7. A quote right before the path is - * not part of it, so both quotes stay around the file name - * (`'C:\Users\Bob\x.db'` gives `'x.db'`). Any other separator becomes `-` (SQLite's "disk I/O error" reads - * "disk I-O error"), so an error line never contains a `/` nor a `\` (#395). + * `/home/marie claire/…`), a backtick, `;`, `|` or a `)` followed by a word + * (`C:\Users\Jean (Work) Smith\…`, #478): from its start, a path runs to its + * LAST separator before a line break, a double quote, a `,` or `:` followed + * by a blank, or a blank followed by another path. When nothing ends it, the + * rule is conservative: text after a path is dropped up to the last separator + * of the line, rather than letting a folder through. With so few stops, that + * costs a readable suffix: `/a/x.db then I/O` and `/a/x.db; I/O` give `O`, + * `(see /a/x.db) and I/O` gives `(see O`. Limits in ADR 0021, section 7. A + * quote right before the path is not part of it, so both quotes stay around + * the file name (`'C:\Users\Bob\x.db'` gives `'x.db'`). Any other separator + * becomes `-` (SQLite's "disk I/O error" reads "disk I-O error"), so an error + * line never contains a `/` nor a `\` (#395). */ export function withoutFolders(text: string): string { let out = ""; -- 2.52.0 From e9d471a292995cb5c3e408d2ffa38532a6e25a7b Mon Sep 17 00:00:00 2001 From: le king fu Date: Fri, 23 Oct 2026 20:37:19 -0400 Subject: [PATCH 2/6] docs(db): describe the stops and limits of withoutFolders after #478 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADR 0021, section 7, and the « Limites connues (#437) » bullet of docs/architecture.md now list the stops that remain (a line break, a double quote, a `,` or `:` followed by a blank, a blank followed by another path) and the cost of the conservative rule (text after a path that holds a separator goes with it: `/a/x.db; I/O` gives `O`). The relative-path limit stays whole. The second limit, a folder name that holds a stop, is reduced, not gone: `C:\Users\jean\Smith, Jean\x.db` still gives `Smith, Jean-x.db`. Under Windows a folder name holds no double quote, colon or line break and an account name no comma, so the profile folder is only left with a blank followed by a path start (`Jean ~`). The PATH_STOP comment says why the two stops are safe. CHANGELOG: one Fixed / Corrigé line in both files. Resolves #478 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.fr.md | 1 + CHANGELOG.md | 1 + docs/adr/0021-migrations-profils-secondaires.md | 2 +- docs/architecture.md | 2 +- src/services/db.ts | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.fr.md b/CHANGELOG.fr.md index 71d88cc..fb70919 100644 --- a/CHANGELOG.fr.md +++ b/CHANGELOG.fr.md @@ -21,6 +21,7 @@ - Import : les messages de « Créer un dossier d'exemple » suivent désormais la langue de l'application : un dossier d'exemple déjà présent dans le dossier d'import (nommé, avec la marche à suivre : actualiser la liste, ou le renommer s'il n'y apparaît pas), un dossier d'import introuvable, une date du jour illisible. Toute autre erreur reste affichée telle que le système l'a écrite. Une fois les dossiers d'exemple écrits, le message de réussite ne s'affiche que si le dossier d'import a pu être relu ; sinon le message d'erreur s'affiche seul, au lieu des deux à la fois (#384). - Import : après le choix d'un autre dossier d'import, l'avertissement des fichiers posés directement dans le dossier d'import ne nomme plus les fichiers de l'ancien dossier sous le nom du nouveau, pendant la lecture du nouveau dossier ou quand il ne peut pas être lu (#446). - Import : un message d'erreur ne reste plus affiché une fois le dossier d'import relu, après « Actualiser » ou après le choix d'un autre dossier par « Parcourir » ; le message d'un dossier d'exemple déjà présent dans le dossier d'import demandait justement d'actualiser. Annuler le choix du dossier garde le message (#384). +- Journaux (Paramètres → Système) : une ligne d'erreur sur l'ouverture ou la fermeture d'un profil ne garde plus le nom d'un dossier qui contient `;`, `|`, une apostrophe inverse ou une parenthèse fermante suivie d'un mot, comme `Jean (Work) Smith` : elle ne nomme que le fichier, comme pour tout autre dossier. Une telle ligne peut partir avec une rétroaction quand vous y incluez les derniers logs d'erreur. En contrepartie, quand le texte qui suit un chemin sur la même ligne contient un `/` ou un `\`, il est désormais retiré avec les dossiers (#478). ### Sécurité diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a0a8ed..b87216b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Import: the messages of “Create a sample folder” now follow the app's language: a sample folder already in the import folder (named, with what to do: refresh the list, or rename it if it does not show up), an import folder that cannot be found, today's date unreadable. Any other error still shows as the system wrote it. Once the sample folders are written, the success message only shows when the import folder could be read again; otherwise the error message shows alone, instead of both at once (#384). - Import: after you choose another import folder, the warning about the files placed directly in the import folder no longer names the previous folder's files under the new folder's name, while the new folder is being read or when it cannot be read (#446). - Import: an error message no longer stays on screen once the import folder is read again, after “Refresh” or after choosing another folder with “Browse”; the message of a sample folder already in the import folder asked for that very refresh. Cancelling the folder choice keeps the message (#384). +- Logs (Settings → System): an error line about opening or closing a profile no longer keeps the name of a folder that holds `;`, `|`, a backtick or a closing parenthesis followed by a word, such as `Jean (Work) Smith`: it names the file only, as for any other folder. Such a line can go with a feedback report when you include the recent error logs. In return, when the text that follows a path on the same line holds a `/` or a `\`, it is now dropped with the folders (#478). ### Security diff --git a/docs/adr/0021-migrations-profils-secondaires.md b/docs/adr/0021-migrations-profils-secondaires.md index 66c9338..b13bd13 100644 --- a/docs/adr/0021-migrations-profils-secondaires.md +++ b/docs/adr/0021-migrations-profils-secondaires.md @@ -58,7 +58,7 @@ Comme sqlx pour le profil par défaut. Une version qui échoue sur une clé étr ### 7. L'échec reste ouvert -Un rattrapage interrompu est écrit au Journal et le profil s'ouvre comme avant #390. Les messages nomment des fichiers, jamais le dossier : il contient le nom d'utilisateur du système, et une ligne d'erreur du Journal peut être jointe à une rétroaction (Loi 25). Un rattrapage qui s'arrête après sa copie la nomme quand même : `catch_up_backup` (nom de fichier seul) est rempli dès que la copie existe, et la ligne d'erreur du Journal finit par « copy of the previous state kept as … » (#395). Côté TypeScript, `withoutFolders` réduit chaque chemin d'une ligne d'erreur, message de repli compris, à son dernier segment (le nom de fichier). Un chemin part d'un début reconnu (lecteur `C:\`, `/`, `~/`, `./`, partage `\\`, ou le `` de `scrub`) et court jusqu'à son dernier séparateur, espaces compris, pour qu'un dossier comme `C:\Users\Jean Dupont\` ou `/home/marie claire/` ne laisse aucun mot derrière lui ; il s'arrête à un saut de ligne, un guillemet double, une apostrophe inverse, `;`, `|`, une virgule ou un deux-points suivis d'un blanc, une parenthèse fermante qui n'est pas suivie d'un séparateur (`Program Files (x86)\` continue), ou un blanc suivi d'un autre chemin. Une apostrophe placée juste avant le chemin reste autour du nom de fichier (`'C:\Users\Bob\x.db'` donne `'x.db'`). Quand rien ne l'arrête, la règle est prudente : elle retire le texte qui suit jusqu'au dernier séparateur de la ligne plutôt que de laisser passer un dossier. Deux limites (précisées par #437). Un chemin relatif sans début reconnu garde l'ancien repli, d'un blanc à l'autre : un morceau qui porte deux séparateurs ou plus est réduit à son dernier segment (`dossier/sous/x.db` donne `x.db`), un morceau qui n'en porte qu'un voit son séparateur remplacé par `-`, si bien que les mots d'un dossier qui contient un blanc restent (`dossier/sous dossier/x.db` donne `dossier-sous dossier-x.db`) ; un tel chemin ne part pas du dossier personnel, donc n'en contient pas le nom. Et un nom de dossier qui contient l'un des arrêts (une apostrophe inverse, `;`, `|`, une parenthèse fermante suivie d'autre chose qu'un séparateur…) arrête le chemin là : ce nom, ou son début, reste dans la ligne, et ce peut être un nom d'utilisateur (`C:\Users\Jean (Work) Smith\AppData\x.db` donne `Jean (Work) x.db`). Tout autre séparateur devient `-` : aucune ligne d'erreur ne contient `/` ni `\`. +Un rattrapage interrompu est écrit au Journal et le profil s'ouvre comme avant #390. Les messages nomment des fichiers, jamais le dossier : il contient le nom d'utilisateur du système, et une ligne d'erreur du Journal peut être jointe à une rétroaction (Loi 25). Un rattrapage qui s'arrête après sa copie la nomme quand même : `catch_up_backup` (nom de fichier seul) est rempli dès que la copie existe, et la ligne d'erreur du Journal finit par « copy of the previous state kept as … » (#395). Côté TypeScript, `withoutFolders` réduit chaque chemin d'une ligne d'erreur, message de repli compris, à son dernier segment (le nom de fichier). Un chemin part d'un début reconnu (lecteur `C:\`, `/`, `~/`, `./`, partage `\\`, ou le `` de `scrub`) et court jusqu'à son dernier séparateur, espaces compris, pour qu'un dossier comme `C:\Users\Jean Dupont\` ou `/home/marie claire/` ne laisse aucun mot derrière lui ; il s'arrête à un saut de ligne, un guillemet double, une virgule ou un deux-points suivis d'un blanc, ou un blanc suivi d'un autre chemin. Un nom de dossier peut contenir une apostrophe inverse, `;`, `|` ou une parenthèse fermante suivie d'un mot (`C:\Users\Jean (Work) Smith\`) : aucun de ces caractères n'arrête le chemin (#478, décision de Max du 2026-10-20). Une apostrophe placée juste avant le chemin reste autour du nom de fichier (`'C:\Users\Bob\x.db'` donne `'x.db'`). Quand rien ne l'arrête, la règle est prudente : elle retire le texte qui suit jusqu'au dernier séparateur de la ligne plutôt que de laisser passer un dossier. C'est le coût d'arrêts aussi rares : un texte qui suit le chemin et porte un séparateur disparaît avec lui (`/a/x.db; I/O` donne `O`, `(see /a/x.db) and I/O` donne `(see O`), alors que `unable to open /a/x.db: disk I/O error` garde son suffixe, le chemin s'arrêtant au deux-points suivi d'un blanc (`unable to open x.db: disk I-O error`). Deux limites (précisées par #437, la seconde réduite par #478). Un chemin relatif sans début reconnu garde l'ancien repli, d'un blanc à l'autre : un morceau qui porte deux séparateurs ou plus est réduit à son dernier segment (`dossier/sous/x.db` donne `x.db`), un morceau qui n'en porte qu'un voit son séparateur remplacé par `-`, si bien que les mots d'un dossier qui contient un blanc restent (`dossier/sous dossier/x.db` donne `dossier-sous dossier-x.db`) ; un tel chemin ne part pas du dossier personnel, donc n'en contient pas le nom. Et un nom de dossier qui contient l'un des arrêts ci-dessus arrête le chemin là : ce nom, ou son début, reste dans la ligne (`C:\Users\jean\Smith, Jean\x.db` donne `Smith, Jean-x.db`). Sous Windows, un nom de dossier ne peut contenir ni guillemet double, ni deux-points, ni saut de ligne, et un nom de compte pas de virgule : le dossier personnel n'y est donc plus concerné que par un blanc suivi d'un début de chemin (`C:\Users\Jean ~\AppData\x.db` donne `Jean x.db`), alors qu'il l'était par une parenthèse suivie d'un mot (`C:\Users\Jean (Work) Smith\AppData\x.db` donnait `Jean (Work) x.db` et donne désormais `x.db`). Tout autre séparateur devient `-` : aucune ligne d'erreur ne contient `/` ni `\`. ### 8. Un seul dossier des bases diff --git a/docs/architecture.md b/docs/architecture.md index 49df9a0..0b2f764 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -690,7 +690,7 @@ Garde : `src/__integration__/i18n-mock-guard.test.ts` lit tous les `*.test.ts(x) ### Limites connues (#437) - **Emplacements préréglés du harnais.** Le harnais donne un emplacement à chaque appel de hook, tous types confondus (`useState`, `useReducer`, `useRef`, `useMemo`, `useCallback`, `useEffect`), dans l'ordre des appels : c'est le helper `slot` de `fakeReact`. Un test qui prérègle un emplacement par sa position (`harness.slots[0] = …`) dépend donc de l'ordre des hooks du composant : un hook ajouté avant, de n'importe quel type, décale les emplacements sans rien dire, et la valeur préréglée tombe sur un autre hook. Préréglages actuels, chacun commenté dans son fichier : `PriceFetchConsentToggle.test.tsx` (emplacements 0 à 2), `PriceFetchControl.test.tsx` (la fenêtre de consentement ouverte), `useOnboardingChecklist.wiring.test.ts` (`mountWith` et deux écritures directes) et `SystemsSettingsPage.test.tsx` ; `OnboardingStepCard.test.tsx` lit le `useRef` de l'emplacement 0. Qui ajoute un hook avant ces emplacements met le test à jour. Un test qui ouvre un état par un clic dans l'arbre rendu (`TransactionTable.wiring.test.ts`) n'a pas cette dépendance. -- **`withoutFolders`.** Ses arrêts et ses deux limites (chemin relatif sans début reconnu ; nom de dossier qui contient l'un des arrêts) sont dans l'[ADR 0021](adr/0021-migrations-profils-secondaires.md), § 7. +- **`withoutFolders`.** Ses arrêts, le coût de sa règle prudente (un texte qui suit un chemin et porte un séparateur disparaît avec lui : `/a/x.db; I/O` donne `O`) et ses deux limites sont dans l'[ADR 0021](adr/0021-migrations-profils-secondaires.md), § 7. La première, un chemin relatif sans début reconnu, reste entière. La seconde, un nom de dossier qui contient l'un des arrêts, est réduite par #478 : une apostrophe inverse, `;`, `|` et une parenthèse fermante n'arrêtent plus rien, et parmi les arrêts qui restent, seul un blanc suivi d'un début de chemin peut figurer dans le dossier personnel sous Windows. - **Mesure du rattrapage.** Le test `#[ignore]` `a_large_profile_catch_up_duration` (`profile_db.rs`) ne tourne pas en CI et n'asserte rien sur la durée : il vérifie que le rattrapage aboutit (aucune erreur, plancher 6), puis imprime la durée. Sa mesure, prise sur un SSD NVMe, et le risque qu'elle ne couvre pas (disque lent, antivirus qui inspecte la copie) sont dans l'[ADR 0021](adr/0021-migrations-profils-secondaires.md), « Négatives et points de vigilance », point « Le délai de démarrage couvre le rattrapage du profil actif ». ## CI/CD diff --git a/src/services/db.ts b/src/services/db.ts index 3ea9346..6ce783f 100644 --- a/src/services/db.ts +++ b/src/services/db.ts @@ -330,8 +330,8 @@ const PATH_START = /[\\/]|[A-Za-z]:[\\/]|~[\\/]|\.{1,2}[\\/]|[\\ const BEFORE_START = /[\s'"`(=:,[]/; /** * What ends the folders of a path for sure: a line break or a double quote, - * which Windows forbids in a name and no real folder holds elsewhere. A - * backtick, `;` and `|` can sit in a folder name, so they end nothing (#478). + * both forbidden in a Windows name. A backtick, `;` and `|` can sit in a + * folder name, so they end nothing (#478). */ const PATH_STOP = /[\n\r"]/; /** The last segment of a path: the file name, kept. */ -- 2.52.0 From 6d353623866cb1aec3bccbb73a4e69ebdf2892df Mon Sep 17 00:00:00 2001 From: le king fu Date: Fri, 23 Oct 2026 20:38:37 -0400 Subject: [PATCH 3/6] test(db): pin the next-path stop past a ) in a test of its own (#478) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pin sat after three assertions of « ends a path at sentence punctuation and at the next path »: a mutation of the next-path stop failed the third one first, so the pin itself was never shown red. Resolves #478 Co-Authored-By: Claude Opus 5.5 --- src/services/db.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/db.test.ts b/src/services/db.test.ts index 4a66a17..8bc5f83 100644 --- a/src/services/db.test.ts +++ b/src/services/db.test.ts @@ -765,7 +765,9 @@ describe("describePreparation (#390)", () => { "read a.db, then b.db" ); expect(withoutFolders("'C:\\a\\b.db' and 'C:\\Users\\Jean Dupont\\d.db'")).toBe("'b.db' and 'd.db'"); - // Past a `)`, the next path still ends the previous one (#478). + }); + + it("withoutFolders still ends a path at the next path past a `)` (#478)", () => { expect(withoutFolders("(see /home/marie claire/a.db) and C:\\Users\\Jean Dupont\\b.db")).toBe( "(see a.db) and b.db" ); -- 2.52.0 From 66d9aadd4a3d49b272c7bd3e2c8af21dac10a06a Mon Sep 17 00:00:00 2001 From: le king fu Date: Fri, 23 Oct 2026 20:43:43 -0400 Subject: [PATCH 4/6] =?UTF-8?q?docs(changelog):=20drop=20the=20=C2=AB=20as?= =?UTF-8?q?=20for=20any=20other=20folder=20=C2=BB=20claim=20(#478)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A folder name that holds a stop kept (a comma followed by a blank, as in `Smith, Jean`) still stays in the line, as ADR 0021 says: the entry now names only what changed, and says the dropped text ends at its last separator. Found by the author's self-review. Resolves #478 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.fr.md | 2 +- CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.fr.md b/CHANGELOG.fr.md index fb70919..8aa0ed5 100644 --- a/CHANGELOG.fr.md +++ b/CHANGELOG.fr.md @@ -21,7 +21,7 @@ - Import : les messages de « Créer un dossier d'exemple » suivent désormais la langue de l'application : un dossier d'exemple déjà présent dans le dossier d'import (nommé, avec la marche à suivre : actualiser la liste, ou le renommer s'il n'y apparaît pas), un dossier d'import introuvable, une date du jour illisible. Toute autre erreur reste affichée telle que le système l'a écrite. Une fois les dossiers d'exemple écrits, le message de réussite ne s'affiche que si le dossier d'import a pu être relu ; sinon le message d'erreur s'affiche seul, au lieu des deux à la fois (#384). - Import : après le choix d'un autre dossier d'import, l'avertissement des fichiers posés directement dans le dossier d'import ne nomme plus les fichiers de l'ancien dossier sous le nom du nouveau, pendant la lecture du nouveau dossier ou quand il ne peut pas être lu (#446). - Import : un message d'erreur ne reste plus affiché une fois le dossier d'import relu, après « Actualiser » ou après le choix d'un autre dossier par « Parcourir » ; le message d'un dossier d'exemple déjà présent dans le dossier d'import demandait justement d'actualiser. Annuler le choix du dossier garde le message (#384). -- Journaux (Paramètres → Système) : une ligne d'erreur sur l'ouverture ou la fermeture d'un profil ne garde plus le nom d'un dossier qui contient `;`, `|`, une apostrophe inverse ou une parenthèse fermante suivie d'un mot, comme `Jean (Work) Smith` : elle ne nomme que le fichier, comme pour tout autre dossier. Une telle ligne peut partir avec une rétroaction quand vous y incluez les derniers logs d'erreur. En contrepartie, quand le texte qui suit un chemin sur la même ligne contient un `/` ou un `\`, il est désormais retiré avec les dossiers (#478). +- Journaux (Paramètres → Système) : une ligne d'erreur sur l'ouverture ou la fermeture d'un profil ne garde plus le nom d'un dossier qui contient `;`, `|`, une apostrophe inverse ou une parenthèse fermante suivie d'un mot, comme `Jean (Work) Smith` : elle ne nomme que le fichier. Une telle ligne peut partir avec une rétroaction quand vous y incluez les derniers logs d'erreur. En contrepartie, le texte qui suit un chemin après l'un de ces caractères et qui contient un `/` ou un `\` est désormais retiré avec les dossiers, jusqu'à son dernier `/` ou `\` (#478). ### Sécurité diff --git a/CHANGELOG.md b/CHANGELOG.md index b87216b..fb2c968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ - Import: the messages of “Create a sample folder” now follow the app's language: a sample folder already in the import folder (named, with what to do: refresh the list, or rename it if it does not show up), an import folder that cannot be found, today's date unreadable. Any other error still shows as the system wrote it. Once the sample folders are written, the success message only shows when the import folder could be read again; otherwise the error message shows alone, instead of both at once (#384). - Import: after you choose another import folder, the warning about the files placed directly in the import folder no longer names the previous folder's files under the new folder's name, while the new folder is being read or when it cannot be read (#446). - Import: an error message no longer stays on screen once the import folder is read again, after “Refresh” or after choosing another folder with “Browse”; the message of a sample folder already in the import folder asked for that very refresh. Cancelling the folder choice keeps the message (#384). -- Logs (Settings → System): an error line about opening or closing a profile no longer keeps the name of a folder that holds `;`, `|`, a backtick or a closing parenthesis followed by a word, such as `Jean (Work) Smith`: it names the file only, as for any other folder. Such a line can go with a feedback report when you include the recent error logs. In return, when the text that follows a path on the same line holds a `/` or a `\`, it is now dropped with the folders (#478). +- Logs (Settings → System): an error line about opening or closing a profile no longer keeps the name of a folder that holds `;`, `|`, a backtick or a closing parenthesis followed by a word, such as `Jean (Work) Smith`: it names the file only. Such a line can go with a feedback report when you include the recent error logs. In return, text that follows a path after one of these characters and holds a `/` or a `\` is now dropped with the folders, up to its last `/` or `\` (#478). ### Security -- 2.52.0 From 90a9a525cf064e09c0de33613a596a1e61fce022 Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 24 Oct 2026 09:02:03 -0400 Subject: [PATCH 5/6] fix(db): keep no folder in the migration repair line of the Journal (#478) connectToProfile wrote the failure of repair_migrations with a raw console.error. repair_migrations returns rusqlite's error unscrubbed, and rusqlite appends the full path of a database it cannot open, so the line carried every folder of that path, user name included, and could go with a feedback report. It now goes through logError(withoutFolders(...)), like the preparation line next to it. Blocking finding B1 of the review of PR #491 (comment 27073); fixing it in the stack is Max's decision of 2026-10-24. Resolves #478 Co-Authored-By: Claude Opus 5.5 --- src/services/db.test.ts | 16 ++++++++++++++++ src/services/db.ts | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/services/db.test.ts b/src/services/db.test.ts index 8bc5f83..90b35cf 100644 --- a/src/services/db.test.ts +++ b/src/services/db.test.ts @@ -598,6 +598,22 @@ describe("a profile is prepared before the plugin opens it (#390)", () => { ); }); + it("writes no folder when the checksum repair fails with a path (#478)", async () => { + // rusqlite appends the full path of a database it cannot open, and + // repair_migrations returns that message as it is. + vi.mocked(invoke).mockImplementationOnce(async () => { + throw "Cannot open database: unable to open database file: C:\\Users\\Jean (Work) Smith\\AppData\\Roaming\\com.simpl.resultat\\profile_0a1b2c3d.db"; + }); + + await connectToProfile("profile_0a1b2c3d.db"); + + expect(vi.mocked(invoke).mock.calls[0][0]).toBe("repair_migrations"); + expect(Database.load).toHaveBeenCalledWith("sqlite:profile_0a1b2c3d.db"); + expect(vi.mocked(logError).mock.calls.map((call) => call[0])).toEqual([ + "Migration repair failed: Cannot open database: unable to open database file: profile_0a1b2c3d.db", + ]); + }); + it("names the copy in the Journal when the catch-up stopped after taking it (#395)", async () => { h.prepare = async () => report({ diff --git a/src/services/db.ts b/src/services/db.ts index 6ce783f..2897f69 100644 --- a/src/services/db.ts +++ b/src/services/db.ts @@ -475,7 +475,10 @@ export function connectToProfile(dbFilename: string): Promise { console.warn("Migration checksums repaired for", dbFilename); } } catch (e) { - console.error("Migration repair failed:", e); + // repair_migrations returns rusqlite's error unscrubbed, and rusqlite + // appends the full path of a database it cannot open: only the file + // name may reach the Journal (#478). + logError(withoutFolders(`Migration repair failed: ${e instanceof Error ? e.message : String(e)}`)); } // Catch a secondary profile up on the migrations tauri-plugin-sql never // runs for it, and repair legacy values in every profile (#390). Fails -- 2.52.0 From f02169c55624a37a55de5d197defbd51731ec347 Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 24 Oct 2026 09:04:37 -0400 Subject: [PATCH 6/6] docs(db): describe the second limit of withoutFolders as it remains (#478) Blocking findings of the review of PR #491 (comment 27073): - B1: the changelog entry now says that the migration repair line, which showed the full path of the database, names the file only (fixed in the previous commit). - B2: ADR 0021 section 7 and docs/architecture.md no longer say that only the folder name, or its start, stays: the folders after it can stay too (`...\Smith, Jean\Notes,\x.db` gives `Smith, Jean-Notes,x.db`), and #478 adds rare cases, measured by the review on 300,000 random lines. Two precisions of the same review, in the same sentences: the suffix kept after a comma or a colon followed by a blank (S2), and the backtick that also reached the home folder (S3, ``C:\Users\O`Brien\x.db``). Resolves #478 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.fr.md | 2 +- CHANGELOG.md | 2 +- docs/adr/0021-migrations-profils-secondaires.md | 2 +- docs/architecture.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.fr.md b/CHANGELOG.fr.md index 8aa0ed5..3c8c7d2 100644 --- a/CHANGELOG.fr.md +++ b/CHANGELOG.fr.md @@ -21,7 +21,7 @@ - Import : les messages de « Créer un dossier d'exemple » suivent désormais la langue de l'application : un dossier d'exemple déjà présent dans le dossier d'import (nommé, avec la marche à suivre : actualiser la liste, ou le renommer s'il n'y apparaît pas), un dossier d'import introuvable, une date du jour illisible. Toute autre erreur reste affichée telle que le système l'a écrite. Une fois les dossiers d'exemple écrits, le message de réussite ne s'affiche que si le dossier d'import a pu être relu ; sinon le message d'erreur s'affiche seul, au lieu des deux à la fois (#384). - Import : après le choix d'un autre dossier d'import, l'avertissement des fichiers posés directement dans le dossier d'import ne nomme plus les fichiers de l'ancien dossier sous le nom du nouveau, pendant la lecture du nouveau dossier ou quand il ne peut pas être lu (#446). - Import : un message d'erreur ne reste plus affiché une fois le dossier d'import relu, après « Actualiser » ou après le choix d'un autre dossier par « Parcourir » ; le message d'un dossier d'exemple déjà présent dans le dossier d'import demandait justement d'actualiser. Annuler le choix du dossier garde le message (#384). -- Journaux (Paramètres → Système) : une ligne d'erreur sur l'ouverture ou la fermeture d'un profil ne garde plus le nom d'un dossier qui contient `;`, `|`, une apostrophe inverse ou une parenthèse fermante suivie d'un mot, comme `Jean (Work) Smith` : elle ne nomme que le fichier. Une telle ligne peut partir avec une rétroaction quand vous y incluez les derniers logs d'erreur. En contrepartie, le texte qui suit un chemin après l'un de ces caractères et qui contient un `/` ou un `\` est désormais retiré avec les dossiers, jusqu'à son dernier `/` ou `\` (#478). +- Journaux (Paramètres → Système) : une ligne d'erreur sur l'ouverture ou la fermeture d'un profil ne garde plus le nom d'un dossier qui contient `;`, `|`, une apostrophe inverse ou une parenthèse fermante suivie d'un mot, comme `Jean (Work) Smith` : elle ne nomme que le fichier. La ligne écrite quand la réparation des migrations d'un profil échoue à son ouverture (« Migration repair failed ») ne nomme plus, elle aussi, que le fichier de la base ; elle en montrait le chemin complet, dossiers de votre compte compris. Ces lignes peuvent partir avec une rétroaction quand vous y incluez les derniers logs d'erreur. En contrepartie, le texte qui suit un chemin après l'un de ces caractères et qui contient un `/` ou un `\` est désormais retiré avec les dossiers, jusqu'à son dernier `/` ou `\` (#478). ### Sécurité diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2c968..69db099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ - Import: the messages of “Create a sample folder” now follow the app's language: a sample folder already in the import folder (named, with what to do: refresh the list, or rename it if it does not show up), an import folder that cannot be found, today's date unreadable. Any other error still shows as the system wrote it. Once the sample folders are written, the success message only shows when the import folder could be read again; otherwise the error message shows alone, instead of both at once (#384). - Import: after you choose another import folder, the warning about the files placed directly in the import folder no longer names the previous folder's files under the new folder's name, while the new folder is being read or when it cannot be read (#446). - Import: an error message no longer stays on screen once the import folder is read again, after “Refresh” or after choosing another folder with “Browse”; the message of a sample folder already in the import folder asked for that very refresh. Cancelling the folder choice keeps the message (#384). -- Logs (Settings → System): an error line about opening or closing a profile no longer keeps the name of a folder that holds `;`, `|`, a backtick or a closing parenthesis followed by a word, such as `Jean (Work) Smith`: it names the file only. Such a line can go with a feedback report when you include the recent error logs. In return, text that follows a path after one of these characters and holds a `/` or a `\` is now dropped with the folders, up to its last `/` or `\` (#478). +- Logs (Settings → System): an error line about opening or closing a profile no longer keeps the name of a folder that holds `;`, `|`, a backtick or a closing parenthesis followed by a word, such as `Jean (Work) Smith`: it names the file only. The line written when the migration repair of a profile fails at opening (“Migration repair failed”) now names the database file only too; it showed the file's full path, folders of your user account included. These lines can go with a feedback report when you include the recent error logs. In return, text that follows a path after one of these characters and holds a `/` or a `\` is now dropped with the folders, up to its last `/` or `\` (#478). ### Security diff --git a/docs/adr/0021-migrations-profils-secondaires.md b/docs/adr/0021-migrations-profils-secondaires.md index b13bd13..1b4c3cd 100644 --- a/docs/adr/0021-migrations-profils-secondaires.md +++ b/docs/adr/0021-migrations-profils-secondaires.md @@ -58,7 +58,7 @@ Comme sqlx pour le profil par défaut. Une version qui échoue sur une clé étr ### 7. L'échec reste ouvert -Un rattrapage interrompu est écrit au Journal et le profil s'ouvre comme avant #390. Les messages nomment des fichiers, jamais le dossier : il contient le nom d'utilisateur du système, et une ligne d'erreur du Journal peut être jointe à une rétroaction (Loi 25). Un rattrapage qui s'arrête après sa copie la nomme quand même : `catch_up_backup` (nom de fichier seul) est rempli dès que la copie existe, et la ligne d'erreur du Journal finit par « copy of the previous state kept as … » (#395). Côté TypeScript, `withoutFolders` réduit chaque chemin d'une ligne d'erreur, message de repli compris, à son dernier segment (le nom de fichier). Un chemin part d'un début reconnu (lecteur `C:\`, `/`, `~/`, `./`, partage `\\`, ou le `` de `scrub`) et court jusqu'à son dernier séparateur, espaces compris, pour qu'un dossier comme `C:\Users\Jean Dupont\` ou `/home/marie claire/` ne laisse aucun mot derrière lui ; il s'arrête à un saut de ligne, un guillemet double, une virgule ou un deux-points suivis d'un blanc, ou un blanc suivi d'un autre chemin. Un nom de dossier peut contenir une apostrophe inverse, `;`, `|` ou une parenthèse fermante suivie d'un mot (`C:\Users\Jean (Work) Smith\`) : aucun de ces caractères n'arrête le chemin (#478, décision de Max du 2026-10-20). Une apostrophe placée juste avant le chemin reste autour du nom de fichier (`'C:\Users\Bob\x.db'` donne `'x.db'`). Quand rien ne l'arrête, la règle est prudente : elle retire le texte qui suit jusqu'au dernier séparateur de la ligne plutôt que de laisser passer un dossier. C'est le coût d'arrêts aussi rares : un texte qui suit le chemin et porte un séparateur disparaît avec lui (`/a/x.db; I/O` donne `O`, `(see /a/x.db) and I/O` donne `(see O`), alors que `unable to open /a/x.db: disk I/O error` garde son suffixe, le chemin s'arrêtant au deux-points suivi d'un blanc (`unable to open x.db: disk I-O error`). Deux limites (précisées par #437, la seconde réduite par #478). Un chemin relatif sans début reconnu garde l'ancien repli, d'un blanc à l'autre : un morceau qui porte deux séparateurs ou plus est réduit à son dernier segment (`dossier/sous/x.db` donne `x.db`), un morceau qui n'en porte qu'un voit son séparateur remplacé par `-`, si bien que les mots d'un dossier qui contient un blanc restent (`dossier/sous dossier/x.db` donne `dossier-sous dossier-x.db`) ; un tel chemin ne part pas du dossier personnel, donc n'en contient pas le nom. Et un nom de dossier qui contient l'un des arrêts ci-dessus arrête le chemin là : ce nom, ou son début, reste dans la ligne (`C:\Users\jean\Smith, Jean\x.db` donne `Smith, Jean-x.db`). Sous Windows, un nom de dossier ne peut contenir ni guillemet double, ni deux-points, ni saut de ligne, et un nom de compte pas de virgule : le dossier personnel n'y est donc plus concerné que par un blanc suivi d'un début de chemin (`C:\Users\Jean ~\AppData\x.db` donne `Jean x.db`), alors qu'il l'était par une parenthèse suivie d'un mot (`C:\Users\Jean (Work) Smith\AppData\x.db` donnait `Jean (Work) x.db` et donne désormais `x.db`). Tout autre séparateur devient `-` : aucune ligne d'erreur ne contient `/` ni `\`. +Un rattrapage interrompu est écrit au Journal et le profil s'ouvre comme avant #390. Les messages nomment des fichiers, jamais le dossier : il contient le nom d'utilisateur du système, et une ligne d'erreur du Journal peut être jointe à une rétroaction (Loi 25). Un rattrapage qui s'arrête après sa copie la nomme quand même : `catch_up_backup` (nom de fichier seul) est rempli dès que la copie existe, et la ligne d'erreur du Journal finit par « copy of the previous state kept as … » (#395). Côté TypeScript, `withoutFolders` réduit chaque chemin d'une ligne d'erreur, message de repli compris, à son dernier segment (le nom de fichier) ; depuis #478, la ligne d'un échec de `repair_migrations`, où rusqlite écrit le chemin complet de la base, y passe aussi. Un chemin part d'un début reconnu (lecteur `C:\`, `/`, `~/`, `./`, partage `\\`, ou le `` de `scrub`) et court jusqu'à son dernier séparateur, espaces compris, pour qu'un dossier comme `C:\Users\Jean Dupont\` ou `/home/marie claire/` ne laisse aucun mot derrière lui ; il s'arrête à un saut de ligne, un guillemet double, une virgule ou un deux-points suivis d'un blanc, ou un blanc suivi d'un autre chemin. Un nom de dossier peut contenir une apostrophe inverse, `;`, `|` ou une parenthèse fermante suivie d'un mot (`C:\Users\Jean (Work) Smith\`) : aucun de ces caractères n'arrête le chemin (#478, décision de Max du 2026-10-20). Une apostrophe placée juste avant le chemin reste autour du nom de fichier (`'C:\Users\Bob\x.db'` donne `'x.db'`). Quand rien ne l'arrête, la règle est prudente : elle retire le texte qui suit jusqu'au dernier séparateur de la ligne plutôt que de laisser passer un dossier. C'est le coût d'arrêts aussi rares : un texte qui suit le chemin et porte un séparateur disparaît avec lui (`/a/x.db; I/O` donne `O`, `(see /a/x.db) and I/O` donne `(see O`), alors que `unable to open /a/x.db: disk I/O error` garde son suffixe, le chemin s'arrêtant au deux-points suivi d'un blanc (`unable to open x.db: disk I-O error`). Deux limites (précisées par #437, la seconde réduite par #478). Un chemin relatif sans début reconnu garde l'ancien repli, d'un blanc à l'autre : un morceau qui porte deux séparateurs ou plus est réduit à son dernier segment (`dossier/sous/x.db` donne `x.db`), un morceau qui n'en porte qu'un voit son séparateur remplacé par `-`, si bien que les mots d'un dossier qui contient un blanc restent (`dossier/sous dossier/x.db` donne `dossier-sous dossier-x.db`) ; un tel chemin ne part pas du dossier personnel, donc n'en contient pas le nom. Et un nom de dossier qui contient l'un des arrêts ci-dessus arrête le chemin là : ce nom, ou son début, reste dans la ligne (`C:\Users\jean\Smith, Jean\x.db` donne `Smith, Jean-x.db`), et parfois les dossiers qui le suivent. La suite est en effet relue comme du texte : un séparateur précédé d'une virgule, d'une apostrophe, d'un `=`, d'un `[` ou du deux-points d'un lecteur ouvre un nouveau chemin, et le repli garde les mots d'un morceau qui ne porte plus qu'un séparateur (`C:\Users\jean\Smith, Jean\Notes,\x.db` donne `Smith, Jean-Notes,x.db`, avant comme après #478). Sans arrêts mous, ce nouveau chemin court plus loin et peut consommer les séparateurs dont le repli avait besoin : #478 ajoute ainsi de rares cas où un mot reste là où l'ancien code le retirait (`C:\Users\jean\Smith, Jean\Notes,\Old;Copy\x.db` donnait `Smith, x.db` et donne `Smith, Jean-Notes,x.db`). Mesure de la revue de la PR #491, sur 300 000 lignes aléatoires : aucune fuite parmi les 179 310 lignes dont aucun nom de dossier ne contient un arrêt conservé (74 609 avant #478) ; parmi les autres, 107 gardent un mot que l'ancien code retirait, dont 6 qui ne laissaient rien passer avant. Toutes les erreurs de `prepare_at` passent d'abord par `scrub` côté Rust, et `withoutFolders` n'y est que le second rideau ; celles de `repair_migrations` n'ont que lui. Sous Windows, un nom de dossier ne peut contenir ni guillemet double, ni deux-points, ni saut de ligne, et un nom de compte pas de virgule : le dossier personnel n'y est donc plus concerné que par un blanc suivi d'un début de chemin (`C:\Users\Jean ~\AppData\x.db` donne `Jean x.db`), alors qu'il l'était aussi par une parenthèse suivie d'un mot (`C:\Users\Jean (Work) Smith\AppData\x.db` donnait `Jean (Work) x.db` et donne désormais `x.db`) et par une apostrophe inverse, qu'un nom de compte peut contenir (``C:\Users\O`Brien\x.db`` donnait ``O`Brien-x.db`` et donne désormais `x.db`). Tout autre séparateur devient `-` : aucune ligne d'erreur ne contient `/` ni `\`. ### 8. Un seul dossier des bases diff --git a/docs/architecture.md b/docs/architecture.md index 0b2f764..8529513 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -690,7 +690,7 @@ Garde : `src/__integration__/i18n-mock-guard.test.ts` lit tous les `*.test.ts(x) ### Limites connues (#437) - **Emplacements préréglés du harnais.** Le harnais donne un emplacement à chaque appel de hook, tous types confondus (`useState`, `useReducer`, `useRef`, `useMemo`, `useCallback`, `useEffect`), dans l'ordre des appels : c'est le helper `slot` de `fakeReact`. Un test qui prérègle un emplacement par sa position (`harness.slots[0] = …`) dépend donc de l'ordre des hooks du composant : un hook ajouté avant, de n'importe quel type, décale les emplacements sans rien dire, et la valeur préréglée tombe sur un autre hook. Préréglages actuels, chacun commenté dans son fichier : `PriceFetchConsentToggle.test.tsx` (emplacements 0 à 2), `PriceFetchControl.test.tsx` (la fenêtre de consentement ouverte), `useOnboardingChecklist.wiring.test.ts` (`mountWith` et deux écritures directes) et `SystemsSettingsPage.test.tsx` ; `OnboardingStepCard.test.tsx` lit le `useRef` de l'emplacement 0. Qui ajoute un hook avant ces emplacements met le test à jour. Un test qui ouvre un état par un clic dans l'arbre rendu (`TransactionTable.wiring.test.ts`) n'a pas cette dépendance. -- **`withoutFolders`.** Ses arrêts, le coût de sa règle prudente (un texte qui suit un chemin et porte un séparateur disparaît avec lui : `/a/x.db; I/O` donne `O`) et ses deux limites sont dans l'[ADR 0021](adr/0021-migrations-profils-secondaires.md), § 7. La première, un chemin relatif sans début reconnu, reste entière. La seconde, un nom de dossier qui contient l'un des arrêts, est réduite par #478 : une apostrophe inverse, `;`, `|` et une parenthèse fermante n'arrêtent plus rien, et parmi les arrêts qui restent, seul un blanc suivi d'un début de chemin peut figurer dans le dossier personnel sous Windows. +- **`withoutFolders`.** Ses arrêts, le coût de sa règle prudente (un texte qui suit un chemin et porte un séparateur disparaît avec lui : `/a/x.db; I/O` donne `O`, sauf derrière une virgule ou un deux-points suivis d'un blanc, qui arrêtent le chemin : `unable to open /a/x.db: disk I/O error` garde son suffixe) et ses deux limites sont dans l'[ADR 0021](adr/0021-migrations-profils-secondaires.md), § 7. La première, un chemin relatif sans début reconnu, reste entière. La seconde, un nom de dossier qui contient l'un des arrêts, est réduite par #478 : une apostrophe inverse, `;`, `|` et une parenthèse fermante n'arrêtent plus rien, et parmi les arrêts qui restent, seul un blanc suivi d'un début de chemin peut figurer dans le dossier personnel sous Windows. Un arrêt qui reste laisse le nom de ce dossier, ou son début, et parfois les dossiers qui le suivent (`…\Smith, Jean\Notes,\x.db` donne `Smith, Jean-Notes,x.db`) ; #478 en ajoute de rares cas, mesurés dans l'ADR. - **Mesure du rattrapage.** Le test `#[ignore]` `a_large_profile_catch_up_duration` (`profile_db.rs`) ne tourne pas en CI et n'asserte rien sur la durée : il vérifie que le rattrapage aboutit (aucune erreur, plancher 6), puis imprime la durée. Sa mesure, prise sur un SSD NVMe, et le risque qu'elle ne couvre pas (disque lent, antivirus qui inspecte la copie) sont dans l'[ADR 0021](adr/0021-migrations-profils-secondaires.md), « Négatives et points de vigilance », point « Le délai de démarrage couvre le rattrapage du profil actif ». ## CI/CD -- 2.52.0