gun
gun copied to clipboard
Initial map().on() not triggering when put called with object
Test available here https://github.com/georgigriffiths/gun/tree/master/test/map
Updated tests and multiple chained get calls are not triggering the map().on(). The data is arriving at the remote node.
So the bug is due to the empty first node.
BAD: gun.get('room/test').get('users').map().on()
GOOD: gun.get('room/test').put({id:'test'}).get('users').map().on()
Any update on this? I'm hitting this right now with something similar to this:
gun.get("doc").map().on((data, key) => {
...
});
gun.get("doc").put({firstName: "John", lastName: "Doe"});
The on
callback triggers properly when first ran, but any data added after that is not propagated.
I think I'm getting the same, if not very similar issue after pulling and running the code from this tutorial https://www.youtube.com/watch?v=J5x3OMXjgMc.
Essentially, if I use a new unique id for the data I'm finding the first entry (or message posted) never shows up, only the following (second, third, etc) messages. Sending a blank first message prior to gun.get("some/room").map().on()
as similar to what is shown by @georgigriffiths above is a workaround.