You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that the problem is caused by a race condition: Edits are propagated with a 150ms delay (due to the use of debounce), so, if the editor receives a new value, the old value has been removed and no longer has the fields that the event handler expects it to have.
I'm not sure if the correct fix is to cancel debounced events when a node is removed (e.g., Lodash's debounce has a cancel function; a similar idea could be added here) or make the events check for, e.g., this.parent == null.
The text was updated successfully, but these errors were encountered:
Thanks for reporting! I don't get the error you report, but when I change the interval in your example from 1000 to 10 I can get a similar error 'Uncaught TypeError: this.parent is null'.
I think you're right and this is because of the debounce. So basically, there are two competing changes: the external change, and the change being made by the user, and we could decide to let either of the two changes "win". I think we should go for the simplest solution, which probably is to make it effectively do nothing by checking if this.parent still exists (cancelling the debounce would be fine with me too, but the used debounce function currently does not have a cancel method).
I'm sporadically getting the following error when I change object keys (not values):
See https://codesandbox.io/s/jsoneditor-debounced-error-76uwry for an example: Try changing
hello
. (This callssetValue
extremely fast to demonstrate the problem.)I believe that the problem is caused by a race condition: Edits are propagated with a 150ms delay (due to the use of
debounce
), so, if the editor receives a new value, the old value has been removed and no longer has the fields that the event handler expects it to have.https://github.com/josdejong/jsoneditor/blob/v9.9.2/src/js/Node.js#L1649
I'm not sure if the correct fix is to cancel debounced events when a node is removed (e.g., Lodash's debounce has a
cancel
function; a similar idea could be added here) or make the events check for, e.g.,this.parent == null
.The text was updated successfully, but these errors were encountered: