Comments (2)
re: storage being passive - I was thinking of trying to shim in something (when I'm further along on the implementation) to allow the storage to not be passive. In particular, I can watch for and get notifications of filesystem changes, which I could use as a "something changed" signal (for example, if someone updated the file on Dropbox and it sync'd across).
I haven't fully implemented the remote-heads bits in my work, but the hooks are there. I honestly hadn't been sure what the purpose for them was and how they were used, and it's on my reading list to sit down and trace javascript code to find out, so you short-circuited that by quite a bit by cobbling this (thank you! - kind of like finding a syncstate in local storage)
re: Peers, right now I'm not storing or tracking anything what IS right now, so no historical tracking of peers. That said, I have expanded on what a peer is for the peer to peer networking pieces that I'm in the midst of writing - in addition to a peer_id, I've added a human-friendly name that can be included with that peerId. I'm sticking to UUID for the peer Ids - although I accept any string. I'd like to have some confidence that it had some uniqueness properties though - I'm just "hoping" right now, and it would be an annoying bug if they weren't)
Along those lines, I'd really like to see us firm up any constraints/expectations on PeerId in terms of uniqueness guarantees, if not specific format.
I'm also applying "peer" to the owner of a repo, since. a repo can have multiple network adapters, to handle the scenario where you might be connected to a peer over two different networks, and I want to avoid the duplication of tracking. So I'm somewhere between "peer as owner" and "peer as session", which probably isn't a great place to land.
The only issues I saw with perhaps using the storage Id as a "true peer" are:
-
you don't HAVE to have a storage adapter, and at that point there's no storage Id, which throws a monkey wrench into a lot of this - what's the fallback there? Or do we say we always have a storage Id, even if it's ephemeral/in-meory only like a repo with no storage provider?
-
there's no clear communication channel upward for a storage system today to say "I just got this update, please apply it to your in-memory representations". Other than an in-memory test storage provider, I haven't written any providers for the swift/Apple native platform pieces yet, where I might tackle the signal back up from storage to the repo, letting it know there's been an external change.
from automerge-repo.
If I was starting from scratch this is how I'd maybe set it up:
userId
: A stable identifier for a single human, bot, or server. Assigned by the application. Could be a uuid, domain name, or email address. ReplacespeerId
as used bysharePolicy
.sessionId
: An ephemeral identifier for a single instance ofRepo
. A uuid, randomly assigned in the constructor.deviceId
: A stable identifier for the device we're running on. A uuid, randomly created on first use by the storage adapter. Different browsers on the same physical device count as different devices. (This is juststorageId
but with semantics that make more intuitive sense to me.)peerId
:{ userId, sessionId, deviceId }
from automerge-repo.
Related Issues (20)
- Repo Gets into a bad state when Automerge URLs are being requested simultaneously HOT 1
- Intermittent CI test failures
- NodeFSStorageAdapter lock exception on large number of updates. HOT 2
- An unavailable document may just not be found yet
- WebSocket Ready flag should only be set after Open event HOT 2
- Get latest changes as a document instead of a binary HOT 5
- Virus detected in github head! Windows Defender Trojan:Script/Wacatac.H!ml HOT 4
- WebSocket client disconnection
- Access to RawString through automerge-repo? HOT 1
- pnpm run dev, pnpm run dev:demo not working HOT 3
- Error: recursive use of an object detected which would lead to unsafe aliasing in rust HOT 4
- network sync protocol leaks documentIds to peers HOT 2
- [Svelte] Counter works but Text doesn't HOT 2
- When a change event is emitted by the handle the `handle.docSync()` is still the old value HOT 5
- Large enough messages block the main thread for a long time, which can lead to socket timeouts on blocked clients HOT 3
- svelte: provide a way to await the document becoming ready HOT 1
- Repo and WebSocket provider send two responses for a "request" - the first unavailable, the second a sync HOT 1
- Share policy prevents fetching document from sync server
- repo.clone error message suggests using "handle.waitForReady", which doesn't exist
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 automerge-repo.