ssbc / ssb-db2

A new database for secure-scuttlebutt
47 stars 8 forks source link

Test onMsgAdded.value #396

Open Powersource opened 1 year ago

Powersource commented 1 year ago

According to the docs https://github.com/ssbc/ssb-db2#onmsgaddedcb you can do like this instead of using the callback

onMsgAdded itself is an obz, so the latest message added to the database can also be read using ssb.db.onMsgAdded.value

but when I tried getting using .value I only got undefined. The callback worked though. When searching I saw that we only test the callback form and not .value, so could be worth doing that to see if it's actually broken/the docs are wrong or if i just used it wrong.

staltz commented 1 year ago

Ah, it might be that the hooks (from secret-stack) borked the obz