[GH-ISSUE #95] update() doesn't accept nested keys #27

Open
opened 2026-05-23 08:38:53 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @fahhem on GitHub (Aug 4, 2023).
Original GitHub issue: https://github.com/appy-one/acebase-server/issues/95

I'm not 100% sure this is the cause, since it's crashing the server rather than the client, but if I comment out this line then I don't get the error:

const updates = { 'sweepRepositories/interval': 1234};
ref.child('queues/cron').update(updates);
failed to update "queues/cron": Error: Invalid key "sweepRepositories/interval" for object to store at path "queues/cron". Keys cannot contain control characters or any of the following characters: \ / [ ]
    at /reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3527:23
    at Array.forEach (<anonymous>)                                                        
    at _writeNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3525:28)
    at _lockAndWriteNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3461:34)
    at async Promise.all (index 0)
    at async _writeNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3563:5)
    at async _mergeNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3436:25)
    at async Object.write [as _customWriteFunction] (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:1945:28)
    at async AceBaseStorage._writeNodeWithTracking (/reviewable/node_modules/acebase/dist/cjs/storage/index.js:660:25)

It seems update(), set(), etc should all handle paths with /'s in them, right?

This is from trying to migrate an existing app, so Firebase's SDK supports this

Originally created by @fahhem on GitHub (Aug 4, 2023). Original GitHub issue: https://github.com/appy-one/acebase-server/issues/95 I'm not 100% sure this is the cause, since it's crashing the server rather than the client, but if I comment out this line then I don't get the error: ```js const updates = { 'sweepRepositories/interval': 1234}; ref.child('queues/cron').update(updates); ``` ``` failed to update "queues/cron": Error: Invalid key "sweepRepositories/interval" for object to store at path "queues/cron". Keys cannot contain control characters or any of the following characters: \ / [ ] at /reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3527:23 at Array.forEach (<anonymous>) at _writeNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3525:28) at _lockAndWriteNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3461:34) at async Promise.all (index 0) at async _writeNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3563:5) at async _mergeNode (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:3436:25) at async Object.write [as _customWriteFunction] (/reviewable/node_modules/acebase/dist/cjs/storage/binary/index.js:1945:28) at async AceBaseStorage._writeNodeWithTracking (/reviewable/node_modules/acebase/dist/cjs/storage/index.js:660:25) ``` It seems update(), set(), etc should all handle paths with `/`'s in them, right? This is from trying to migrate an existing app, so Firebase's SDK supports this
gitea-mirror added the
feature request
label 2026-05-23 08:38:53 -06:00
Author
Owner

@appy-one commented on GitHub (Sep 20, 2023):

@fahhem AceBase doesn't support this yet - it is a cool feature though so I will definitely consider implementing it!

<!-- gh-comment-id:1728283844 --> @appy-one commented on GitHub (Sep 20, 2023): @fahhem AceBase doesn't support this yet - it is a cool feature though so I will definitely consider implementing it!
Author
Owner

@appy-one commented on GitHub (Sep 20, 2023):

This code should be refactored to use

const updates = { interval: 1234 };
ref.child('queues/cron/sweepRepositories').update(updates);
<!-- gh-comment-id:1728286356 --> @appy-one commented on GitHub (Sep 20, 2023): This code should be refactored to use ```js const updates = { interval: 1234 }; ref.child('queues/cron/sweepRepositories').update(updates); ```
Author
Owner

@fahhem commented on GitHub (Oct 3, 2023):

That is just an example, the code in question actually has multiple updates in the dict at different levels of nesting, which means I can't simply refactor it like that. Also, this is another non-Firebase-compatible API. Is there no interest in matching Firebase's API anymore?

<!-- gh-comment-id:1745904129 --> @fahhem commented on GitHub (Oct 3, 2023): That is just an example, the code in question actually has multiple updates in the dict at different levels of nesting, which means I can't simply refactor it like that. Also, this is another non-Firebase-compatible API. Is there no interest in matching Firebase's API anymore?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase-server#27
No description provided.