Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING postCreate before URL redirect #7167
In some cases we must do something async after creation but before redirect. And the redirect must not happen until our async operation is complete. This is now possible. For instance in OKpilot when creating an Objective auto-linked to a Process, the newly created Objective must not be reloaded until after the Process was actually linked to the Objective via the postCreate hook. Otherwise we would incorrectly show an Objective without Process, which would not match DB content. That use-case was not clearly visible before, because all cases until now were many-to-many relations, and those relations were loaded slightly later, probably giving enough time for the link mutation to finish. And even if the link was not complete yet, it was harder to notice that one element in a list in a tab was missing, compared to a very obvious natural-select on default tab. The old behavior to do something after the redirect is still possible by returning `EMPTY` and doing the async work "later".
- Loading branch information