Conversation
6124bc8 to
b8a7143
Compare
There was a problem hiding this comment.
Pull request overview
Fixes object listing edge-cases where repeated / delimiters in keys produce empty folder names / incorrect child derivation, and makes non-name sorting deterministic with folders-first ordering.
Changes:
- Add a shared
getNextCommonPrefix()helper and use it inlistObjectsV2()to skip empty segments and validate prefix/key alignment. - Update tenant DB migration to adjust prefix-derivation helpers and
storage.search()to handle empty segments and enforce stable folders-first ordering for non-name sorts. - Extend test coverage for list-v1 and list-v2 repeated-delimiter behaviors and stable ordering.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/object.test.ts | Adds list-v1 regression tests + refactors shared Knex transaction cleanup in tests. |
| src/test/object-list-v2.test.ts | Adds list-v2 repeated-delimiter regression tests and unit tests for getNextCommonPrefix(). |
| src/storage/object.ts | Introduces getNextCommonPrefix() and uses it for delimiter grouping in listObjectsV2(). |
| src/internal/database/migrations/types.ts | Registers new tenant migration fix-common-prefix-empty-segments as version 59. |
| migrations/tenant/0059-fix-common-prefix-empty-segments.sql | Updates SQL helper functions and storage.search() to skip empty path segments and apply deterministic folders-first ordering for non-name sorts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
b8a7143 to
46e527d
Compare
46e527d to
0e99200
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0e99200 to
8ec6761
Compare
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
8ec6761 to
1cfe5f0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 24186761058Coverage increased (+0.02%) to 80.84%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
|
Awesome change! however i'm wondering if the original index now is useless and we need to create a new index because of the function use? |
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Repeated
/segments in object keys make list misidentify children by producing blank folders or blank names.What is the new behavior?
Skip empty path segments and derive the first real child name instead.
Additional context
Validate prefix/key alignment before deriving child paths.
Make non-name sorting deterministic with explicit folder-first ordering.