Comments (5)
So, we've got dynamic queries, the history is improved, and I've just added ptransact!
. The latter allows for manual sequential full-stack interactions that make error handling straightfoward for old-school interactions.
The automated stuff I'm aiming for with this ticket is going to be pretty interesting to implement. The fully-working history means that we can safely rewind UI to the point in history at which our last network interaction occurred. This means we can auto-retry on errors while the user is allowed to continue to work (possibly showing a "saving..." indicator in the UI somewhere. If the network stays gone too long, then we can rewind to the last-known-good spot, show them a dialog, and let them choose "retry some more, or restart from here"
from fulcro.
Follow up. Your comments are quoted.
I also wonder about the limits of optimistic update on lag.
This is a scary thought indeed. But it hasn't been a problem for us yet.
Fulcro augmented Om Next by ensuring that tempids that appear in the network queue get rewritten on tempid remappings...so you can actually queue a create and update in sequence and have them work in complete optimistic mode.
Same here. We also update our mutations that are queued to get the correct id.
In the talk, the assumption is that your mutations might return something different from what you'd done optimistically. I think this is wrong.
We usually implement optimistic updates where we can fake what the correct result should be. E.g sending a chat message, it should show up in the chat. But I can recall times where we've done an optimistic mutation showing the user a "pending" result, that differs from the server's response and is replaced by it. There are other ways of implementing such behaviour though.
Regarding linear history. Our first attempt was to have a single history with no branches, but it got too hard for us when trying to do optimistic updates that had to be retracted or merged such that nothing changes when the response from the server matches the current state. You may have better ideas on how to implement it, but I found it very hard both to think about and to implement compared to the git-rebase version.
For some context, our first project was a budget web app where it was really nice to have optimistic updates. Now, we've released an e-commerce marketplace with live streaming (http://sulo.live) and it doesn't need as many optimistic updates. It's nice to have some times, like for the chat.
I agree with how you think mutation errors should be handled. I.e. auto-loop with back-off and rewind. We've got the auto-loop but not the rewind, but it sounds like a good idea!
from fulcro.
The chat example is an interesting case. That is a case where you are direct-collaborating in a distributed system, but the problem there is "time" and "relativity". I think I'd implement that one without optimistic updates at all (you typing a message sends it to the server, and websocket pushes are always how things end up in your chat window). That way the server resolves "who spoke when". I guess you could do optimistic and use the server's timestamp with the "rebase" idea, and that is an example where that model is needed if you want to do it optimistically (though so is agreement on time).
I guess if you take the collaborative editing example of any kind (where optimistic updates are desired) then you have a much harder problem, and one that potentially makes kind of a mess. If we were both in offline-mode while editing the same line of text our interspersed edits would just as likely end up gibberish as anything useful.
from fulcro.
The new work on Fulcro 2.0 will improve dynamic queries and history to make this scheme possible. Hoping to have it done by the end of November, if not sooner.
from fulcro.
This last bit is really issue #49
from fulcro.
Related Issues (20)
- Unnecessary re-rendering HOT 3
- Denormalize should not "detect loop" for leaf entities HOT 2
- Associate a list of components with a different instance of a state machine each HOT 1
- Mutation params are "closed over" on mutation submission, which causes problem in result actions. HOT 9
- Warnings about missing initial state for anonymous components with a `:componentName` HOT 7
- `comp/get-query` not correct when using raw component and union query HOT 4
- Fix text area and table examples exploding width HOT 2
- Fulcro 3.6 w/React 18
- http error 404 on github-pages HOT 2
- Fulcro 3.6 use of React Context breaks shouldComponentUpdate optimizations HOT 9
- http-remote :status-code is always 500 on error HOT 6
- Potentially add "Accept: application/transit+json" header. HOT 1
- Potentially omitted :force-root in `schedule-render!` HOT 5
- dr/change-route-relative! -- denied route does not call :route-denied component option HOT 1
- Dependency issue with taoensso.encore/dissoc-in HOT 2
- fs/dirty-fields misses recursive field HOT 1
- Link/ident queries don't work with `false` values
- dynamic routing question HOT 1
- HTTP middleware for making load/mutations work easily with JSON http APIs.
- Hook-based defsc should also have their parent set
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 fulcro.