Skip to content

Fix empty sort key condition isolation issue#533

Merged
tywalch merged 1 commit intotywalch:masterfrom
sphaugh:fix-empty-sk-condition-isolation
Dec 13, 2025
Merged

Fix empty sort key condition isolation issue#533
tywalch merged 1 commit intotywalch:masterfrom
sphaugh:fix-empty-sk-condition-isolation

Conversation

@sphaugh
Copy link
Copy Markdown
Contributor

@sphaugh sphaugh commented Oct 28, 2025

When comparison queries (gt, lt, etc.) were called with an empty object,
the sort key prefix omitted the first composite attribute label (e.g.,
"$tasks_1" instead of "$tasks_1#team_"). This caused queries to
incorrectly match items across different entity versions, breaking
entity isolation.

Fixed by checking if composite attributes are provided before setting
excludeLabelTail in _makeIndexKeysWithoutTail.

When comparison queries (gt, lt, etc.) were called with an empty object,
the sort key prefix omitted the first composite attribute label (e.g.,
"$tasks_1" instead of "$tasks_1#team_"). This caused queries to
incorrectly match items across different entity versions, breaking
entity isolation.

Fixed by checking if composite attributes are provided before setting
excludeLabelTail in _makeIndexKeysWithoutTail.
@netlify
Copy link
Copy Markdown

netlify bot commented Oct 28, 2025

Deploy Preview for electrodb-dev canceled.

Name Link
🔨 Latest commit b34ac95
🔍 Latest deploy log https://app.netlify.com/projects/electrodb-dev/deploys/6901336ba9d76000086cbb48

@tywalch
Copy link
Copy Markdown
Owner

tywalch commented Dec 13, 2025

Great work!

@tywalch tywalch merged commit 6054b0a into tywalch:master Dec 13, 2025
4 checks passed
anatolzak pushed a commit to anatolzak/electrodb that referenced this pull request Jan 1, 2026
When comparison queries (gt, lt, etc.) were called with an empty object,
the sort key prefix omitted the first composite attribute label (e.g.,
"$tasks_1" instead of "$tasks_1#team_"). This caused queries to
incorrectly match items across different entity versions, breaking
entity isolation.

Fixed by checking if composite attributes are provided before setting
excludeLabelTail in _makeIndexKeysWithoutTail.
tywalch added a commit that referenced this pull request Jan 3, 2026
@tywalch
Copy link
Copy Markdown
Owner

tywalch commented Jan 3, 2026

Flagging this PR, it may need to be rolled back: #540

tywalch added a commit that referenced this pull request Jan 4, 2026
tywalch added a commit that referenced this pull request Jan 4, 2026
* Rolls back the changes added via PR 533
#533

* Rolls back the changes added via PR 533
#533
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.

2 participants