Closed grrowl closed 7 years ago
verifyAsync
optionverifyAsync: function (action, cb)
cb(true)
: verified messagecb(false)
: invalid message, remove it from _updates
.verifyStrict: bool
to withhold unverified messages from replaying to peers
verifyStrict
is false
questions
cb(true)
, do we replay that action with meta.@@signature/VERIFIED: true
cb(false)
, pretend like that action never happened.
verifyStrict
, simply drop it from _updates
verifyStrict
, remove it from history_updates
/orderedHistory
merge workRelated discussion, "Why syncing actions instead of data model?"
There's also a bit of talk about CRDTs which don't really require the time travel functionality we've implemented, but they're not hurt by it. Currently, an action like ADD_MESSAGE
can simply return state.concat(message)
(that is, push it onto the state array) and even outdated/old actions from remote peers will be inserted at the correct position in the array.
With dispatcher options verifyAsync
and signAsync
added, message signing and validation can be enabled by other modules (such as the in-progress redux-signatures)
I've released a Component-based userland solution. It generates an ed25519
privateKey
on mount, and passes down the functionssignMessage
,verifyMessage
andgenerateKey
to its children as props.What would be the perfect API for this feature? Does it belong in redux-scuttlebutt or does it make sense as an auxiliary module?