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
Noticed a case where my query is firing between two interface-effects, causing the query to be run with the wrong values and failing.
Need to observe this more to figure exactly what causes is, but it might be some timing thing related to one of the interface-atoms being from a query affected by the first.
exportconstsettingsToViewInterfaceEffects: InterfaceEffects<SettingsToViewInterface>=[(getInterfaceValue,setAtomValue)=>{// ! Likely relevant: the header here is also dependent on field. The atom is a "fix-up" selection from a async list of the field's available wellboresconstwellboreUuid=getInterfaceValue("wellboreHeader");setAtomValue(wellboreHeaderAtom,wellboreUuid);},(getInterfaceValue,setAtomValue)=>{constselectedField=getInterfaceValue("selectedField");setAtomValue(selectedFieldIdentAtom,selectedField);},];
For this, when swapping field - from DROGON to FIELD_A - a dependent query I have in the module's view code is being fired with the parameters field=DROGON&wellbore_uuid=some_wellbore_id, but it should be field=FIELD_A&wellbore_uuid=some_wellbore_id. So only the wellbore UUID atom has updated, according to tanstack.
Also, worth nothing:
Both effect functions are being run
As far as I can gleam from the console, both effects are both run before the xhr request is being started, but could be that tanstack is picking the values earlier than that
The system never runs a query with the correct values.
If changing the wellbore-header after the fact, a correct query is fired
The text was updated successfully, but these errors were encountered:
It seems that what's happening, is that Jotai always recomputes all derived atoms between each setAtomValue call. Does this not mean that every interface-effect in the system potentially runs multiple uneccessary recomputations? We might need to change how the interface effects are handled if so...
Noticed a case where my query is firing between two interface-effects, causing the query to be run with the wrong values and failing.
Need to observe this more to figure exactly what causes is, but it might be some timing thing related to one of the interface-atoms being from a query affected by the first.
For this, when swapping field - from DROGON to FIELD_A - a dependent query I have in the module's view code is being fired with the parameters
field=DROGON&wellbore_uuid=some_wellbore_id
, but it should befield=FIELD_A&wellbore_uuid=some_wellbore_id
. So only the wellbore UUID atom has updated, according to tanstack.Also, worth nothing:
The text was updated successfully, but these errors were encountered: