Page MenuHomeElementl

[dagit] Simplify repository reload logic
ClosedPublic

Authored by sashank on Dec 16 2020, 8:33 AM.

Details

Summary

It turns out that when you have a query that uses no-cache, calling refetch won't update every every instance of that query. This was causing inconsistent behavior based on what screen you were on, and sometimes showing two error messages at the same time.

This diff simplifies the data fetching for repository locations to always pull data from the WorkspaceContext. The state observer logic has also been updated to call refetch on the root repository locations query. The only tradeoff here is that if you're in a location that has error-ed out, you will see an error screen immediately. The previous complexity was to provide an intermediary message before they head over to the repository-locations page to debug. It seems fine to error out because users can't do anything until the location is back up anyway, and their next immediate action is the same in either case.

Test Plan
  • Press reload button on sidebar
  • Press reload button in instance page under repository locations
  • Check auto-reload works

Diff Detail

Repository
R1 dagster
Branch
simply-reload
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 16 2020, 8:39 AM
Harbormaster failed remote builds in B22954: Diff 27917!
Harbormaster returned this revision to the author for changes because remote builds failed.Dec 16 2020, 9:09 AM
Harbormaster failed remote builds in B22955: Diff 27918!
sashank edited the test plan for this revision. (Show Details)
sashank added a reviewer: dish.
This revision is now accepted and ready to land.Dec 16 2020, 8:24 PM
This revision was automatically updated to reflect the committed changes.