Comments (5)
I talked this over with @alexjg earlier today and I think what we want is something roughly like the following:
- DocHandle should have a queryable DocumentState which is (for now) "OPENING", "READY", "DELETED" or "FAILED".
- OPENING and FAILED either have "reasons" or "substates" or some such concept: FAILED might be a bad document ID (INVALID_URL) or no/weak network connection leading to timeout (NO_SOURCE).
- In the future, FAILED should have retry logic if new peers come along
- In automerge-repo-react-hooks, useDocument should also return the DocumentState (third argument?) and we should implement an example which allows the user to differently render OPENING (download progress?), READY (normal) and FAILED (recovery suggestions: connect to network, check URL, etc).
- DELETED just comes along for the ride here but one can imagine an
undelete
which might re-request the document from peers.
from automerge-repo.
Continuing to make notes to self here: we could use a global/shared progress timeout that resets if any data comes in for any document so that documents don't timeout when they're in a queue awaiting their turn.
from automerge-repo.
@acurrieclark i added a FAILED state that we transition to { after: this.#timeoutDelay } and the tests... seem the same. I think I need some other kind of test here but I'm not exactly sure what it is. Probably we should start exposing the DocumentState.
from automerge-repo.
Okay, I have exposed the current state's name and test that we do enter "failed". I think we can build on this but this is an improvement. I'm going to try and finish an Automerge URL patch today so that I can go into the weekend with a clear conscience.
from automerge-repo.
We discussed this just now and agreed that timeouts should have the same behaviour as "unavailable" (not an error, return undefined.)
from automerge-repo.
Related Issues (20)
- Delete protocol HOT 1
- Unable to use automerge-repo in Deno: Property 'on' missing from 'Repo'
- Handle unavailable files with no storage/peers better HOT 7
- How should the "unavailable" status interact with network adapter startup? HOT 3
- Storage Snapshots HOT 1
- Storage Snapshots HOT 1
- Lose extra diff HOT 10
- apps under /examples don't seem to work HOT 4
- can't load automerge repo HOT 4
- Allow Svelte's `document` store to explicitely receive the `repo` HOT 4
- Sync server scalability for live collaboration HOT 7
- On failure, and what to do about it HOT 2
- Cover reconnection bug with a test
- Don't bundle React with the hooks package HOT 5
- Timeout in DocHandle waitFor prevents process from exiting. HOT 3
- Data durability question HOT 8
- Any reason for `StorageAdapter` to be an abstract class as opposed to an interface
- "Error: DocHandle is not ready" with useBootstrap HOT 3
- Wrong peerMetadata Sent on Message receive in BroadcastChannel adapter HOT 4
- OPFS storage adapter HOT 2
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.