enso icon indicating copy to clipboard operation
enso copied to clipboard

Remove optimistic query hooks

Open somebody1234 opened this issue 1 year ago • 1 comments

Pull Request Description

  • One of many PRs that should improve Dashboard performance.
    • useMutationState seems to be taking quite a bit of time (224ms out of 1199ms) in this trace on Firefox:
    • However, I haven't really noticed any real difference, although I haven't tried too hard to find a differene
    • That said, this also vastly simplifies the code in backendHooks.ts (by removing the vast majority of the methods)
    • As a downside, well, we will no longer have optimistic updates - but I guess we are preferring a stale-while-revalidate approach anyway (React Query) when it doesn't degrade UX

image

image

Important Notes

None

Testing Instructions

  • Theoretically none, as this should only make the logic more correct, if anything, because we are removing a layer of indirection.
    • Otherwise, test the features that use the components present in the diff. (assets table, category switcher, user, org, members table and user groups settings pages)

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • [x] ~~The documentation has been updated, if necessary.~~
  • [x] ~~Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.~~
  • [x] All code follows the Scala, Java, TypeScript, and Rust style guides. In case you are using a language not listed above, follow the Rust style guide.
  • [x] ~~Unit tests have been written where possible.~~

somebody1234 avatar Aug 28 '24 08:08 somebody1234

Recreated problem with 200 local projects and this actually bumped performence quite nicely. ✅

PabloBuchu avatar Aug 28 '24 10:08 PabloBuchu

this one i will consider as not needing CR as it is basically just removing code - all refactors in files other than backendHooks.ts are just switching away from the custom hooks back to the single function

somebody1234 avatar Sep 03 '24 11:09 somebody1234