Closed da-h closed 1 year ago
~That's interesting: the variable seems to be required for react 17 (tests are failing now). However, I've tested it on react 16 successfully without any errors. As 18 gives some very good changes, like automatic batched processing, I'll suggest to look into this PR once/if visdom runs under react 18.~
It seems there is a bug in the ImagePane or its test, introduced by combining #900 and #902.
With #908 in-place, this PR succeeds all tests now & is thus now ready for review.
I see!! I would have not thought about this. Thanks for clarifying. :+1:
I'll update this the next days to your proposed solution.
I've just implemented the window-message versioning, to replace consistent_pane_copy
.
With the background-information of how this mechanism worked, I now also understood the reason for the setTimeout
inside of the _checkWindow
(now called updateWindow
) function:
postForEnv
storeData
using such timers, say update1 and update2 (that builds upon the changes in update1). In case the pane is saved, just when update1 is re-queued using a new timer and update2 checks for the existence of the pane, which is now given, the changed patch could lead to a wrong state, or possibly even to an error.Using the idea of specifying the version
of each pane state, we can circumvent the timers:
processPane
-function and remember the last version that we know is waiting to be processedstoreData
and matches our expectation of the previous version. Or, If it does not exist or the version does not match, we check also if there is a update waiting to be processed, with our expected version of the pane state.Just to be sure:
This PR does change the server-client-api by replacing the requirement of hashing the window contents. Also, this PR removes the win_hash
endpoint.
Personally I think, since this will be part of 1.0.0
, incompatible api-changes should be ok to occur(?)
Especially, as the new implementation ~should work~ works with older saved environments, i.e. backwards-compatibility is at least data-wise ensured.
Description
This PR
consistent_pane_copy
fromjs/main.js
/win_hash
(as it is not used anymore in the project)processPane
method. this is required to save some requests where the whole window content would have be resent (see notes below).Motivation and Context
(See discussion below).
How Has This Been Tested?
(Just the cypress tests).
Types of changes
Checklist:
py/visdom/VERSION
according to Semantic Versioning