[GH-ISSUE #68] Error when invoking .set function #49

Closed
opened 2026-05-23 08:28:10 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @paradis-A on GitHub (Feb 6, 2022).
Original GitHub issue: https://github.com/appy-one/acebase/issues/68

Feel free to close this if irrelevant. Mentioning possible fix.

[test] Index build /bounds//search_field (fulltext) started
[test] Reading node "/" from address 0,0
[test] Node "/" being updated: adding 1 keys ("bounds"), updating 0 keys (), removing 0 keys ()
[test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v/search_field" saved at address 0,17 - 1 addresses, 68 bytes written in 1 chunk(s)
[test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v" saved at address 0,18 - 2 addresses, 144 bytes written in 1 chunk(s)
[test] Node "/bounds" saved at address 0,20 - 1 addresses, 38 bytes written in 1 chunk(s)
[test] Node "/" saved at address 0,0 - 1 addresses, 34 bytes written in 1 chunk(s)
[test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v" from address 0,18
[test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v" from address 0,18
[test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v/search_field" from address 0,17
[test] Can't find event subscriptions to stop (path: "bounds/ckzavyllh000b3p61u4fhbn8v", event: (any), callback: undefined)
[test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v/search_field" from address 0,17
[test] Indexed "/bounds/ckzavyllh000b3p61u4fhbn8v/search_field" value: 'ckzavyllh000b3p61u4fhbn8v,stockpileinboundtresttres' (object)
[test] done writing values to ./test.acebase/bounds-search_field.fulltext.idx.build
{ key: 'ckzavylli000c3p613rorwn7x', cost: 1500, quantity: 1 }
[test] Index build /bounds/
/materials//key started
[test] Index build /bounds/
/materials/*/search_field (fulltext) started
[test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v" from address 0,18
[test] done writing build file ./test.acebase/bounds-search_field.fulltext.idx.build
[test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v" being updated: adding 1 keys ("materials"), updating 0 keys (), removing 0 keys ()
[test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v/materials/ckzavylli000c3p613rorwn7x" saved at address 0,21 - 1 addresses, 113 bytes written in 1 chunk(s)
[test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v/materials" saved at address 0,22 - 1 addresses, 38 bytes written in 1 chunk(s)
[test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v" saved at address 0,18 - 2 addresses, 154 bytes written in 1 chunk(s)
C:\System\lenlen\lendb-server\node_modules\acebase\src\api-local.js:728
typeof oldValue === 'object' && Object.keys(oldValue).forEach(key => !seenKeys.includes(key) && seenKeys.push(key));
^

TypeError: Cannot convert undefined or null to object
at Function.keys ()
at Object.childChangedCallback [as callback] (C:\System\lenlen\lendb-server\node_modules\acebase\src\api-local.js:728:60)
at C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:494:25
at Array.forEach ()
at Object.trigger (C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:493:18)
at C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:1066:51
at Array.forEach ()
at triggerAllEvents (C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:1012:14)
at processTicksAndRejections (internal/process/task_queues.js:75:11)
[nodemon] app crashed - waiting for file changes before starting...

Originally created by @paradis-A on GitHub (Feb 6, 2022). Original GitHub issue: https://github.com/appy-one/acebase/issues/68 Feel free to close this if irrelevant. Mentioning [possible fix](https://github.com/appy-one/acebase/pull/66). [test] Index build /bounds/*/__search_field__ (fulltext) started [test] Reading node "/" from address 0,0 [test] Node "/" being updated: adding 1 keys ("bounds"), updating 0 keys (), removing 0 keys () [test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v/__search_field__" saved at address 0,17 - 1 addresses, 68 bytes written in 1 chunk(s) [test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v" saved at address 0,18 - 2 addresses, 144 bytes written in 1 chunk(s) [test] Node "/bounds" saved at address 0,20 - 1 addresses, 38 bytes written in 1 chunk(s) [test] Node "/" saved at address 0,0 - 1 addresses, 34 bytes written in 1 chunk(s) [test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v" from address 0,18 [test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v" from address 0,18 [test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v/__search_field__" from address 0,17 [test] Can't find event subscriptions to stop (path: "bounds/ckzavyllh000b3p61u4fhbn8v", event: (any), callback: undefined) [test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v/__search_field__" from address 0,17 [test] Indexed "/bounds/ckzavyllh000b3p61u4fhbn8v/__search_field__" value: 'ckzavyllh000b3p61u4fhbn8v,stockpileinboundtresttres' (object) [test] done writing values to ./test.acebase/bounds-__search_field__.fulltext.idx.build { key: 'ckzavylli000c3p613rorwn7x', cost: 1500, quantity: 1 } [test] Index build /bounds/*/materials/*/key started [test] Index build /bounds/*/materials/*/__search_field__ (fulltext) started [test] Reading node "/bounds/ckzavyllh000b3p61u4fhbn8v" from address 0,18 [test] done writing build file ./test.acebase/bounds-__search_field__.fulltext.idx.build [test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v" being updated: adding 1 keys ("materials"), updating 0 keys (), removing 0 keys () [test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v/materials/ckzavylli000c3p613rorwn7x" saved at address 0,21 - 1 addresses, 113 bytes written in 1 chunk(s) [test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v/materials" saved at address 0,22 - 1 addresses, 38 bytes written in 1 chunk(s) [test] Node "/bounds/ckzavyllh000b3p61u4fhbn8v" saved at address 0,18 - 2 addresses, 154 bytes written in 1 chunk(s) C:\System\lenlen\lendb-server\node_modules\acebase\src\api-local.js:728 typeof oldValue === 'object' && Object.keys(oldValue).forEach(key => !seenKeys.includes(key) && seenKeys.push(key)); ^ TypeError: Cannot convert undefined or null to object at Function.keys (<anonymous>) at Object.childChangedCallback [as callback] (C:\System\lenlen\lendb-server\node_modules\acebase\src\api-local.js:728:60) at C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:494:25 at Array.forEach (<anonymous>) at Object.trigger (C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:493:18) at C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:1066:51 at Array.forEach (<anonymous>) at triggerAllEvents (C:\System\lenlen\lendb-server\node_modules\acebase\src\storage.js:1012:14) at processTicksAndRejections (internal/process/task_queues.js:75:11) [nodemon] app crashed - waiting for file changes before starting...
gitea-mirror 2026-05-23 08:28:10 -06:00
Author
Owner

@appy-one commented on GitHub (Feb 6, 2022):

Thanks for your report and pull request, really appreciate it!

I do think this is a duplicate of #61 however

While your fix will definitely prevent the error, it does not fix the issue at hand. The main reason for this is because the event handler is expecting data to be delivered, but notify_child_changed event handlers do (and should) not get any data. As I've mentioned in the other issue, changing the notify_child_changed to child_changed subscription should be the right fix for now.

<!-- gh-comment-id:1030831960 --> @appy-one commented on GitHub (Feb 6, 2022): Thanks for your report and pull request, really appreciate it! I do think this is a duplicate of #61 however While your fix will definitely prevent the error, it does not fix the issue at hand. The main reason for this is because the event handler is expecting data to be delivered, but `notify_child_changed` event handlers do (and should) not get any data. As I've mentioned in the other issue, changing the `notify_child_changed` to `child_changed` subscription should be the right fix for now.
Author
Owner

@appy-one commented on GitHub (Feb 21, 2022):

Fix for this is published with acebase version 1.15.0

<!-- gh-comment-id:1047095220 --> @appy-one commented on GitHub (Feb 21, 2022): Fix for this is published with acebase version 1.15.0
Author
Owner

@paradis-A commented on GitHub (Feb 22, 2022):

I confirm bug is now fixed. Closing this now.

<!-- gh-comment-id:1047391163 --> @paradis-A commented on GitHub (Feb 22, 2022): I confirm bug is now fixed. Closing this now.
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#49
No description provided.