WeKnora/internal/application
YG52052051 cab16dcacb
fix(storage): strip storage-backend scope in local provider path normalization (#2979)
KB deletion runs on the process-wide default file service, which is not
wrapped by BackendScopedFileService. Storage-scoped physical paths
("storage://<backend-id>/local://<tenant>/...") therefore reach the raw
local provider, fall through to the relative-path branch, and get joined
under baseDir — producing a nonexistent path so every os.Remove fails with
ENOENT and the physical files silently leak on every KB/document delete.

normalizePathForBase now strips the scope wrapper up front (both the
canonical "storage://" form and the "storage:/" form produced when a path
has been through filepath.Clean), and tolerates the cleaned "local:/"
provider scheme. Unscoped paths are unaffected.

Co-authored-by: YG52052051 <YG52052051@users.noreply.github.com>
2026-09-21 14:21:25 +08:00
..
access feat(artifacts): let users delete generated files (#3447) 2026-09-20 13:01:46 +08:00
repository fix(queue): order ClaimBatch by fail_count so retries cannot starve new work (#3444) 2026-09-21 13:00:29 +08:00
service fix(storage): strip storage-backend scope in local provider path normalization (#2979) 2026-09-21 14:21:25 +08:00