-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: optional commit/rollback #30
Conversation
I'm noticing this solution won't be enough. Every one of those complete actions dequeues from the outbox. I don't understand why dequeueing is coupled to the commit or rollback behaviour. What if you don't want anything to happen when the update succeeds (For example, when you know an action will eventually succeed and you don't care when it does). |
You could specify a default action in Why did you change what |
I changed what |
About the default complete action, I'm thinking that if the user doesn't provide a commit mechanism, then it should complete with an action of type |
That sounds good. |
I agree with your suggestion. What about naming it |
…tional during rollback procedure.
I've added the default commit action and added a test. Now that I think about it, do we also need a default rollback behavior? |
I think rollback is also a nice feature to have. I would add the request action type as a meta inside the defaults, because if you start abusing this feature you won't be able to trace the request that resulted in the commit/rollback. Other than that seems good! |
@sebasgarcep could you implement the last changes so we can merge this? |
@sorodrigo I've had a very busy couple of days, but I now have some time to work on it. :) |
@sorodrigo @wacii I've merged develop into this branch. I think this pull request is ready, and it's waiting for you to merge into develop. |
@sebasgarcep You handle default commit and default rollback dispatches differently. If the user specifies |
@wacii If the user provides |
@sebasgarcep That's true, but I think the resulting error message from redux would be enough to direct the user to a solution. With I would handle the rollback actions the same way you handled the commit action. Just pass the We could throw or warn if the user provides an incorrect |
Alternatively you could remove |
@wacii I don't think we should remove |
@sebasgarcep I was suggesting keeping |
@wacii Sorry I misunderstood. I've made the changes. Could you review them? |
@sebasgarcep Changes look good. Ultimately I'd like to use Flow to provide type checking for Added a couple small changes. Extended tests to look for Also added the offline action as metadata onto the default actions. |
Flow fails... I'm just going to revert my changes for now. Alright, I'll revisit my changes later today. |
86c5950
to
661d542
Compare
It was a randomly failing test, which I'll have to look into, but it passes for now. Adding the offline action into meta is the only meaningful change. Do we just want that on default actions or all of them? |
I think only on default ones because those are |
Thanks @wacii for your changes! |
Thanks @wacii @sorodrigo for making this possible! Could we also open an issue with a roadmap before the next release? |
Makes commit/rollback actions optional.
Could anyone review this commit? @wacii @sorodrigo @bsouthga