Comments (3)
Add verifyAsync
option
- expose option
verifyAsync: function (action, cb)
cb(true)
: verified messagecb(false)
: invalid message, remove it from_updates
.
- expose option
verifyStrict: bool
to withhold unverified messages from replaying to peers- it will probably still have to influence the logical clock. we can't roll it back.
- [wish] allow dispatching before validation, even when
verifyStrict
is false- we'll have to increment the logical clock, even for invalid actions; or play the message with a made-up logical timestamp
- if we're strictly validating actions, they shouldn't ever increment the logical clock
questions
- on
cb(true)
, do we replay that action withmeta.@@signature/VERIFIED: true
- orderedHistory says yes: keeps all history states in line with the latest reality
- on
cb(false)
, pretend like that action never happened.- if
verifyStrict
, simply drop it from_updates
- if not
verifyStrict
, remove it from history - seems like this gets in the way of the
_updates
/orderedHistory
merge work
- if
from redux-scuttlebutt.
Related 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.
from redux-scuttlebutt.
With dispatcher options verifyAsync
and signAsync
added, message signing and validation can be enabled by other modules (such as the in-progress redux-signatures)
from redux-scuttlebutt.
Related Issues (14)
- [Discussion] Why syncing actions instead of data model? HOT 6
- Synchronization on the state diff level HOT 1
- Action log compaction
- Scopes (sharding/subscriptions) HOT 1
- Chat demo errors HOT 2
- Don't gossip actions which don't change state
- Usage with create-react-app
- Using with existing socket connection? HOT 1
- Missing action.timestamps HOT 6
- Improve/switch underlying protocol implementation HOT 6
- using with connect() HOT 5
- Some actions aren't replayed or replayed out of order (visible in examples/counter) HOT 1
- Replay scuttlebutt updates from orderedHistory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-scuttlebutt.