-
-
Notifications
You must be signed in to change notification settings - Fork 694
Dexie Cloud: replacePrefix converts the modified property to an object during sync #2113
Copy link
Copy link
Closed
Description
When using the replacePrefix function from dexie to modify tree structure paths, the transformation works correctly in offline mode but fails after syncing with the server. Instead of executing the string replacement, the server returns a serialized version of the operation, breaking the application's tree structure.
db.treeNodes
.where('parentPath')
.startsWith(`${node.parentPath}${node.id}/`)
.modify({
parentPath: replacePrefix(node.parentPath, newParentPath)
});- When offline: This operation works as expected, properly modifying the parentPath strings
- After sync: The server returns an object instead of the transformed string:
{
"parentPath": {
"replacePrefix": ["old_prefix", "new_prefix"]
}
}This breaks the application as it expects parentPath to be a string, not an object.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Released