You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that we are issuing the same hasura subscriptions multiple times on certain endpoints.
Inspecting websocket traffic for subscription SubActivityDirectives I can see that on page load we are sending the same subscribe message twice:
Unless I'm missing something, these are two unique subscriptions to the same query with the same planId variable.
I can see future updates over the socket come in twice:
Looking at effects.ts it appears we import activityDirectivesDB which is one subscription but we also create another when we call getActivitiesForPlan (
Does this create a second? Should getActivitiesForPlan just use the activityDirectivesDB which has already been initialized?
I'm not super familiar with aerie so maybe this is by design, but it seems kinda wasteful. Could also be causing unneeded re-renders on data that hasn't actually changed.
Reproduction
just inspect traffic in devtools
Logs
No response
System Info
chrome
Severity
Minor
The text was updated successfully, but these errors were encountered:
@sqlAlchemyNoob2004 Yeah, getActivitiesForPlan is more for getting the activities for the plan more immediately for processing plan export, whereas the subscription is to handle updates after loading the plan view. They definitely use the same query except one should just be a fetch vs a websocket. This is still good to look more in to in general though. Thank you!
@duranb wanted to update this and say this issue isn't limited to subscriptions
i'm seeing this for regular queries as well, most egregiously on the parsed dictionaries. the response of these queries can be pretty big, so it would be good to not double request them if not needed:
Checked for duplicates
Yes - I've already checked
Is this a regression?
No - This is a new bug
Version
2.11.12
Describe the bug
It appears that we are issuing the same hasura subscriptions multiple times on certain endpoints.
Inspecting websocket traffic for
subscription SubActivityDirectives
I can see that on page load we are sending the same subscribe message twice:Unless I'm missing something, these are two unique subscriptions to the same query with the same
planId
variable.I can see future updates over the socket come in twice:
Looking at
effects.ts
it appears we importactivityDirectivesDB
which is one subscription but we also create another when we callgetActivitiesForPlan
(aerie-ui/src/utilities/effects.ts
Lines 2896 to 2897 in 3f19529
Does this create a second? Should
getActivitiesForPlan
just use theactivityDirectivesDB
which has already been initialized?I'm not super familiar with aerie so maybe this is by design, but it seems kinda wasteful. Could also be causing unneeded re-renders on data that hasn't actually changed.
Reproduction
just inspect traffic in devtools
Logs
No response
System Info
Severity
Minor
The text was updated successfully, but these errors were encountered: