Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Non published references are returned by DataSync when using include([Array of refs]) function and the UIDs are mixed up #54

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,11 @@ export class Stack {

for (let i = 0, j = oldShelf.length; i < j; i++) {
const element: IShelf = oldShelf[i]
// Adjust position if needed (e.g., if item was removed before the current position)
if (Number(element.position) >= element.path.length) {
element.position = (element.path.length - 1).toString(); // Ensure position is within bounds
}

let flag = true
for (let k = 0, l = result.docs.length; k < l; k++) {
if (result.docs[k].uid === element.uid) {
Expand Down Expand Up @@ -1755,7 +1760,7 @@ export class Stack {
oldEntryQueries = null

for (let i = oldObjectPointerList.length - 1, j = 0; i >= j; i--) {
const element: IShelf = oldObjectPointerList[i]
const element: IShelf = oldObjectPointerList[i]
let flag = true
for (let k = 0, l = result.docs.length; k < l; k++) {
if (result.docs[k].uid === element.uid) {
Expand Down
Loading