From fc9eac9cf316928db604ecf4d116cc1809abb58b Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 31 Aug 2023 12:35:03 -0400 Subject: [PATCH] Backport PR #2411: handle ping without timestamp --- CHANGES.rst | 2 ++ jdaviz/core/template_mixin.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index abaaf2d859..d5510a86a2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,8 @@ Bug Fixes Previously this resulted in a traceback, but now applies the default selection for single-select mode. [#2404] +- Fixes tracebacks from plugins opened in popout windows. [#2411] + Cubeviz ^^^^^^^ diff --git a/jdaviz/core/template_mixin.py b/jdaviz/core/template_mixin.py index 5e915050a6..2eaa413803 100644 --- a/jdaviz/core/template_mixin.py +++ b/jdaviz/core/template_mixin.py @@ -233,6 +233,10 @@ def user_api(self): return PluginUserApi(self, expose=[]) def vue_plugin_ping(self, ping_timestamp): + if isinstance(ping_timestamp, dict): + # popout windows can sometimes ping but send an empty dictionary instead of the + # timestamp, in that case, let's set the latest ping time to now + ping_timestamp = time.time() * 1000 self._ping_timestamp = ping_timestamp # we've received a ping, so immediately set plugin_opened state to True