Skip to content

Rework fallback for uploads with uuid - #33

Merged
GianniCarlo merged 2 commits into
mainfrom
feat/upload-uuid-fallback-move
Jul 15, 2026
Merged

Rework fallback for uploads with uuid#33
GianniCarlo merged 2 commits into
mainfrom
feat/upload-uuid-fallback-move

Conversation

@GianniCarlo

Copy link
Copy Markdown
Contributor

No description provided.

@GianniCarlo GianniCarlo self-assigned this Jul 15, 2026
Comment thread src/services/db/LibraryDB.ts
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

✅ Claude PR Review — PASS

This PR refactors LibraryDB's move/rename/promote flows into a single parameterized rewriteKeyPrefix subtree-rewrite primitive, adds an upload uuid-fallback (moveUploadTarget/moveItemToKey) so a client re-uploading a locally-moved item is treated as a move instead of tripping the uuid unique index, and routes all S3 relocation through the shared processMovedFiles helper. Authorization is sound: every new and refactored query is scoped by user_id derived from req.user.id_user, and no client-supplied id is trusted, so no IDOR is introduced. All raw SQL uses ? placeholders with no user-input interpolation, and the new escapeLikePrefix actually hardens the prior unescaped LIKE matching (a folder like My_Books can no longer capture MyXBooks). The changed routes remain behind checkSubscription/requireCloudData, no secrets or destructive migrations are present, and the change is backed by comprehensive characterization tests. No blocking issues found.

Findings: no findings

Model claude-opus-4-8 · run log · 0 new · 0 carried over · 1 resolved · advisory (a human should still review). Duplicate findings are de-duplicated and stale ones auto-resolved across pushes.

Guard processMovedFiles against the null-on-error contract of the key
rewrite wrappers so a failed rewrite surfaces its real error instead of
an opaque TypeError on .length.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@GianniCarlo
GianniCarlo merged commit 64f5122 into main Jul 15, 2026
2 checks passed
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