chore: use initLog() in utils, to handle use case when LSP server is not loaded #6424
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up to influxdata/flux-lsp#618
The LSP wasm was panicking due to use of a logger which was not compatible with wasm. The recent LSP version bump included:
initLog()
in the UI, to handle race condition if LSP server is not loaded --> but LSP utils methods are usedImpact in UI.
We do have a current, frequent bug in the UI where the dashboard fails after a panic occurs in the LSP wasm. As we did not know the root of the panic (and we didn't have any error logs from the wasm), we focused instead on the cascading nature of the variables tie-in with dashboards.
Recently, we became aware of that fact that our lack of logging from wasm in prod (especially during instances of wasm panic) was directly due to our logging causing the panics. This is a followup PR to ensure that the global logger is always set.
Checklist