deephaven / deephaven-plugins

Deephaven Plugins
5 stars 12 forks source link

Deephaven UI spams logs about unable to resolve variable names #539

Open mattrunyon opened 1 month ago

mattrunyon commented 1 month ago

Description

This bug causes a bunch of log spam FAILED_PRECONDITION: Could not resolve 'sourceId': no variable exists with name 'text'

The issue is if the user does not have Close panels on disconnect enabled and the server is restarted, dh.ui has stale data in the pluginDataMap that never gets cleared. It tries to load the widget on every page load even if there is no panel associated with it.

I think we are trying to load every widget on page load and aren't checking or don't know if there are any panels associated with the widget.

Steps to reproduce

  1. Open a clean browser window (incognito is easiest) and open Deephaven
  2. In the console overflow menu, uncheck Close panels on disconnect
  3. Run this Python code
    from deephaven import ui
    text = ui.text("Test")
  4. Restart the core server.
  5. Reload the page (with the now blank panel created by the above code still open)
  6. (Expected/Actual results 1 here)
  7. Close the panel
  8. Reload the page again
  9. (Expected/Actual results 2 here)

Expected results

  1. (Step 6) Error resolving variable in the console. Error on the panel
  2. (Step 9) No error printed to the console.

Actual results

  1. (Step 6) No error on the panel. Error resolving variable in the console.
  2. (Step 9) Error printed to the console.

Versions

Deephaven UI: 0.14.0