Skip to content

Commit 97f2b85

Browse files
fix: keep flux in sync when select a new measurement with existing fields and tag values selection (#6446)
* fix: use _updateLsp when change measurement selection with existing flux composition * fix: add bucket to `toAdd` for composition re-initialization
1 parent 92aecda commit 97f2b85

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/languageSupport/languages/flux/lsp/connection.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,13 @@ export class ConnectionManager {
393393
this._first_load = false
394394
break
395395
case 'false|true|true':
396-
// re-sync just turned on.
396+
// 1) re-sync just turned on or
397+
// 2) measurement selection is changed when fields
398+
// and/or tag values were previously selected
399+
if (!toAdd.bucket) {
400+
// bucket is needed for initialization
401+
toAdd.bucket = schema.bucket
402+
}
397403
if (shouldRemoveDefaultMsg) {
398404
this._removeDefaultAndUpdateLsp(() => this._initLspComposition(toAdd))
399405
} else {

0 commit comments

Comments
 (0)