Page MenuHomeElementl

[dagit] Refactor components with subscriptions

Authored by dish on Jul 27 2021, 6:09 PM.
Referenced Files
Unknown Object (File)
Thu, Dec 1, 1:28 PM
Unknown Object (File)
Wed, Nov 30, 6:04 PM
Unknown Object (File)
Wed, Nov 30, 5:20 PM
Unknown Object (File)
Sat, Nov 26, 3:46 PM
Unknown Object (File)
Mon, Nov 21, 3:45 AM
Unknown Object (File)
Sat, Nov 19, 4:48 PM
Unknown Object (File)
Wed, Nov 16, 3:30 AM
Unknown Object (File)
Tue, Nov 15, 2:57 PM



There are three components that use DirectGraphQLSubscription. Refactor these to be SFCs. The next objective here will be to grab more information about the WebSocket connection from context: namely, connection parameters that could be defined at the application root. These would currently be ignored because the DirectGraphQLSubscriptions are independent of the WebSocketLink set up in AppProvider.

Next steps:

  • Modify WebsocketStatusProvider to supply more values intended for WebSocket usage
  • Move the SubscriptionClient in AppProvider to WebsocketStatusProvider
  • Delete WebSocketLink from AppProvider, because we don't really use it
Test Plan

View runs in Dagit, start a few. Verify that WebSockets are set up correctly, receive messages as intended, and results are rendered properly as they arrive.

Start Dagit with grpc, restart grpc. Verify that the repository location observer shows the appropriate message in the left nav.

Diff Detail

R1 dagster
Lint Not Applicable
Tests Not Applicable

Event Timeline

This looks good! I could have sworn there was more of a reason these were class components (shouldComponentUpdate or something like that...) but it doesn't seem like it. The new SFC implementations look equivalent to me sans that one setNodes([]) call 👍


It looks like this no longer calls ` this.setState({nodes: []});` before switching the subscription to a new runId. I'm not sure that this SFC is ever given a new runId after it's mounted in practice, but would be good to keep in here!

This revision is now accepted and ready to land.Jul 27 2021, 6:53 PM

setNodes() when runId changes