Skip to content

fix(storage): allow currency and unicode symbols in file path sanitization - #120

Open
markusbrand wants to merge 1 commit into
masterfrom
fix/storage-symbol-path-sanitization
Open

markusbrand wants to merge 1 commit into
masterfrom
fix/storage-symbol-path-sanitization

Conversation

@markusbrand

Copy link
Copy Markdown
Owner

Summary

Fixes an issue where file and folder path segment sanitization rejected filenames containing the ASCII dollar sign ($) and Unicode currency or symbol characters (€, £, ¥, ©, ™, °, etc.) or Office temporary lockfiles (~$Document.docx).

When users uploaded or synced these files, the server returned 400 Bad Request: Unsafe path segment, causing persistent sync failures and warning states on desktop clients.

Changes

  • Backend storage sanitization (backend/app/files/storage.py):
    • Updated _SAFE_SEGMENT_ASCII regex to include $.
    • Updated _is_safe_path_char to allow $ and Unicode category S (symbols, including currency Sc, math Sm, modifier Sk, and other symbols So).
  • Tests (backend/tests/test_storage.py):
    • Added unit tests verifying resolve_user_path accepts $, €, £, ¥, ~$Doc.docx, ©, ™, and °.
  • OpenSpec:
    • Scaffolded and validated fix-storage-symbol-path-sanitization change specification artifacts.

Verification

  • Ran PYTHONPATH=backend .venv/bin/python -m pytest backend -q (110 passed).
  • Ran full project QA suite ./scripts/run-qa.sh (all components passed: client-tauri, web, backend, docs).

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.

1 participant