Code Monkey home page Code Monkey logo

Comments (5)

pvh avatar pvh commented on August 17, 2024

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.

pvh avatar pvh commented on August 17, 2024

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.

pvh avatar pvh commented on August 17, 2024

@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.

pvh avatar pvh commented on August 17, 2024

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.

pvh avatar pvh commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.