canjs / can-connect

Model layer utilities for every JavaScript framework! Assemble real-time, high performance, restful data connections.
https://canjs.com/doc/can-connect.html
MIT License
29 stars 16 forks source link

connection.updatedlist throws error when items inside the list are no longer in the DOM #344

Closed QiruiSun closed 7 years ago

QiruiSun commented 7 years ago

How often can you reproduce it?

Description:

In our situation, we are trying to use super-map for one of our models. When the super-map finishes background fetch, it triggers baseconnection.updatedlis to update the list which is currently in the dom. However, our filter did some changes to the dom already and some elements in the list are no longer in the DOM by the time updatedlist tries to do the update. That will result in an error of 'undefined method push of null' thrown by parent.replacements.push(nodeList) in the can-view-nodelist.js.

I think it is because it tries to make changes to the element that is not present in DOM anymore.

Environment:

Software Version
can-connect version 1.5.5
Browser
Operating system
phillipskevin commented 7 years ago

This is a duplicate of https://github.com/canjs/can-view-nodelist/issues/27. Thanks for submitting.