Skip to content
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
2 changes: 1 addition & 1 deletion managers/asset-operations-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export default class AssetOperationsManager {
dataset.private = kcTools.generateMissingIdsForBlankNodes(dataset.private);

// Group private triples by subject and flatten
const privateTriplesGrouped = kcTools.groupNquadsBySubject(dataset.private, true);
const privateTriplesGrouped = kcTools.groupNquadsBySubject(dataset.private, false).sort();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Array Sorting Fails Without Comparator

The .sort() method called on an array of arrays without a comparator function will convert each array element to a string and sort based on string comparison, rather than comparing the arrays' contents properly. This produces unpredictable ordering for the grouped private triples. Either provide a custom comparator function or reconsider the sorting approach to match the intended behavior change described in the PR title "Changed sort method for private".

Fix in Cursor Fix in Web

dataset.private = privateTriplesGrouped.flat();

// Compute private root and add to public
Expand Down