Closed haadcode closed 2 years ago
I reverted the change for the IDs as I'm uncertain of backwards compatibility.
This PR is ready for review!
This PR is required by https://github.com/orbitdb/orbit-db/pull/933
Merged.
Thank you @tabcat for your review and improvement suggestions! 🙏 ❤️
Published as v1.12.1 in npm
This PR will change the counter store and index to use
identity.id
as the counter ID and thus fixes merging counters.Before this PR, the counter ID (ie. database ID) and the user ID (ie. writer ID) got mixed up resulting in mangled state where, while having correct data from updates/writes, contained also a counter for the database ID. This isn't supposed to be the case and counters should only contains pairs of
(writerID, value)
.This PR also changes the CounterStore to useidentity.id
instead ofidentity.publicKey
as the writer's ID. This makes the ID length shorter, from047bf7a74b85cc51a2080dac60dc6e1734343c73bc5c1c03ee68a2104f97e3fd8981833892f96110a281cd0ebf50e7cd32ffe93142b3dd238aaaba3c2903010a55
to025a8e1ac19907f097cae707e7527cea9f46fc62af171def339a3174f663cb6ddc
which will save bytes in the underlying data format (and replication/transfer bytes).Not sure if this is backwards compatible (because of the key change). If not, we can drop the change of publicKey->id from the PR.