FileNameSanitizer: hostile-name edge cases survive mutation (73% score)
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #722 de @DeepDiver1975 — fusionado
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Read Files/FileNameSanitizer.cs, the listed mutation survivors, and the relevant tests under tests/Lagebuch.Domain.Tests; first run make mutate PROJECT=Domain to inspect the report. Add a test for each listed hostile input and verify each test fails against its mutant. The issue also asks to raise the floor in tests/Lagebuch.Domain.Tests/stryker-config.json; done means the new tests cover the cases and the Domain mutation score floor is raised. An open linked pull request (#722) already covers this work.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The weekly mutation run (2026-10-21, run 39560645989) scores Files/FileNameSanitizer.cs at 73 %. That is low for code at the trust boundary: it cleans the file names a sync peer sends and the names read back from an .fwincident. Line numbers below are as of 058273e.
These survivors are hostile-input paths with no test:
| Line | Survivor | What goes untested |
|---|---|---|
| 61 | the IsNullOrWhiteSpace early return null removed |
TrySanitize(null). Without the guard, fileName.Trim() throws, so no test passes null. |
| 80 | TrySanitize(...) ?? fallback (no coverage) |
Sanitize returning its fallback when nothing usable is left, e.g. "..." or "" |
| 100 | <= MaxFileNameBytes → < |
a name of exactly 255 UTF-8 bytes being kept as is |
| 107, 110 | >= MaxFileNameBytes → >; the pathological branch (no coverage) |
an "extension" of 255 bytes or more. Without that branch, new byte[MaxFileNameBytes - extensionBytes] gets a negative size and throws. |
| 119 | flush: false → true |
a stem cut right at a surrogate pair. With flush: true, half an emoji is encoded as a replacement character. |
Line 68 (IndexOf(...) < 0 → <= 0) is equivalent on Linux, because the first invalid character there is \0, which IsHidden already drops. Leave it.
Reproduce
make mutate PROJECT=Domain
# report: StrykerOutput/Domain/reports/mutation-report.html, file Files/FileNameSanitizer.cs
Suggested approach
Follow AGENTS.md: write one test per row that replays the hostile name and fails against its mutant first:
null;- a name made only of dots or bidi overrides;
- a 255-byte name;
"a." + new string('x', 300);- a long stem of emoji cut at the limit.
Fixing these raises Domain's score. Raise its floor in tests/LageBuch.Domain.Tests/stryker-config.json in the same pull request.
- Lenguaje dominante
- C#
- Estrellas
- 1
- Forks
- 3
- Merge medio
- 4 h 15 min
- PR fusionados (30 d)
- 181
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CodeForFire/lagebuch
-
Stammdaten: in the Checkliste editor the PFLICHT header is not aligned with its columnPosiblemente ocupada @Saad-elnagar la tomó hace 2 días. Abiertobug ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
CodeForFire/lagebuch#714 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Stammdaten: on a phone the Fahrzeuge editor squeezes Wache and Funkrufname to nothingPosiblemente ocupada @Saad-elnagar la tomó hace 2 días. Abiertobug ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
CodeForFire/lagebuch#713 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
CodeForFire/lagebuch#405 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
CodeForFire/lagebuch#349 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
CodeForFire/lagebuch#348 ·
Los mantenedores suelen responder en 1 día
Todos los issues de CodeForFire/lagebuch
Issues similares
-
dev/release: verify-release-candidate.sh runs 0 Java tests with Debian's MavenPosiblemente ocupada @kou la tomó hoy. AbiertoType: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/arrow-adbc#4947 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/fluentui-blazor#5535 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 74/100
AvaloniaUI/Avalonia#22582 ·
Los mantenedores suelen responder en 2 días
-
:watch: Not Triaged CAC
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/AspNetCore.Docs#38001 ·
Los mantenedores suelen responder en 1 día
-
HTTP logging truncates catch-all route parameters in the formatted request pathPosiblemente ocupada @johnkaram02 la tomó hoy. Abiertoarea-telemetry untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/extensions#7883 ·
Los mantenedores suelen responder en 1 día