Skip to content

Commit e76f934

Browse files
authored
fix(5342): with flux-LSP composition released, test and debug coordination (UI vs LSP vs editor) (#5541)
Debug race conditions on sync, unsync, page reload, and turning on feature flag. Debug using fields and tagValues -- while handling race conditions while quickly inserting or removing multiple of these. Also make the session state always be updatable when not synced, except cannot update the session `synced` prop while diverged (a.k.a. cannot re-sync after divergence).
1 parent 28e841f commit e76f934

File tree

6 files changed

+279
-111
lines changed

6 files changed

+279
-111
lines changed

src/dataExplorer/components/SchemaBrowserHeading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const SchemaBrowserHeading: FC = () => {
5757
</FlexBox>
5858
</FlexBox>
5959
),
60-
[fluxSync]
60+
[fluxSync, toggleFluxSync]
6161
)
6262
}
6363

src/dataExplorer/context/fluxQueryBuilder.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ export const FluxQueryBuilderProvider: FC = ({children}) => {
261261

262262
// Schema
263263
selection,
264+
selection.fields,
265+
selection.tagValues,
264266
searchTerm,
265267

266268
children,

src/dataExplorer/context/persistance.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {TimeRange, RecursivePartial} from 'src/types'
33
import {DEFAULT_TIME_RANGE} from 'src/shared/constants/timeRanges'
44
import {useSessionStorage} from 'src/dataExplorer/shared/utils'
55
import {Bucket, TagKeyValuePair} from 'src/types'
6-
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
76
import {
87
RESOURCES,
98
ResourceConnectedQuery,
@@ -100,11 +99,7 @@ export const PersistanceProvider: FC = ({children}) => {
10099

101100
const setSchemaSelection = useCallback(
102101
schema => {
103-
if (
104-
isFlagEnabled('schemaComposition') &&
105-
selection.composition?.diverged
106-
) {
107-
// TODO: how message to user?
102+
if (selection.composition?.diverged && schema.composition.synced) {
108103
return
109104
}
110105
const nextState: SchemaSelection = {
@@ -117,7 +112,7 @@ export const PersistanceProvider: FC = ({children}) => {
117112
}
118113
setSelection(nextState)
119114
},
120-
[selection, selection.composition, setSelection]
115+
[selection.composition, selection.fields, selection.tagValues, setSelection]
121116
)
122117

123118
const save = () => {

0 commit comments

Comments
 (0)