fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
2020-10-23T00:49:43.395600Z

When handling a remote error I have a use case where I want to reset the app state to before the action. I noticed there is no state-before-action in the env map passed to error-action - it is only available in the remote section - I am passing it to the error-action by swapping it into the fulcro app runtime atom. Is this just an oversight, that the state-before-action is not available in the error-action handler?

tony.kay 2020-10-23T02:45:56.397Z

@danvingo just an oversight…the logic for that is in the http://book.fulcrologic.com/#_result_action default result action. Just look at the code, it is very simple once you read that part of the book. I’d accept a PR, and you can also just override the built-in one with one patched to your needs.

2020-10-23T14:46:53.410500Z

Thanks Tony. I'll look into making a PR.

Mr. Savy 2020-10-23T03:15:26.397100Z

ok, thanks!

Mr. Savy 2020-10-23T05:02:02.410100Z

I don't know if this is a bug or not, but I've been trying to get past an issue for a while now to no avail. If I have a defrouter set up to point to some component test I run into an issue. test's initial state has one component that it grabs initial state from, X. test grabs the initial state of X twice with two different sets of static data. call the sets S1 and S1. In test's body, if I call the factory ui-xon S1and S2then S2's result is copied into S1. to be more specific, whatever data I passed into X for S1is essentially overridden and instead of test's body displaying S1and S2it just displays S2 twice. (the maps passed into the body look identical). I have found that the issues goes away if I switch the :query from [... {:test/S1 (comp/get-query X)...} to [... :test/S1 ...]. I will write up an example gist tomorrow, but if anyone recognizes a potential cause in the meantime help would be appreciated.

2020-10-23T14:46:53.410500Z

Thanks Tony. I'll look into making a PR.

Tyler Nisonoff 2020-10-23T18:49:24.413100Z

I’m running into an issue with pessimistic transactions — I’m calling (comp/transact! this [(a) (b)] {:optimistic? false}) But b never gets called … I added debug logging at the end of a on the server, and in its ok-action / error-action but my logging at the beginning of b is never triggered.. If i re-order them, both get called — anyone run into anything similar before?

tony.kay 2020-10-25T03:28:15.415200Z

I really recommend not using those, but I'm not aware of any bugs

Tyler Nisonoff 2020-10-25T03:30:07.416100Z

Sorry, not using which aspects? Optimistic: false?

tony.kay 2020-10-25T03:31:44.416700Z

Correct

tony.kay 2020-10-25T03:32:28.417500Z

That is a legacy feature. You should instead just do logic in action handlers of a

Tyler Nisonoff 2020-10-25T03:32:56.417900Z

👍 makes sense, thanks!

1👍