UofS-CEPHIL / modelcollab

A web-based application for collaborating on simulation models in real-time using Firebase
28 stars 0 forks source link

Encountered too many re-renders error when deleting flows #1

Closed longg-phamm closed 1 year ago

longg-phamm commented 2 years ago

When the user has a large number of stocks and flows, deleting a flow results in a "too many re-renders" error. Suspect the error might come from firebase.

Console: error1

error2

Firebase state JSON: { "components": [ null, { "1": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "44" }, "type": "flow" }, "2": { "data": { "initvalue": "", "text": "2", "x": 102, "y": 423 }, "type": "stock" }, "8": { "data": { "initvalue": "", "text": "8", "x": 960, "y": 183 }, "type": "stock" }, "9": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "43" }, "type": "flow" }, "10": { "data": { "initvalue": "", "text": "10", "x": 111, "y": 128 }, "type": "stock" }, "11": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "25" }, "type": "flow" }, "15": { "data": { "dependsOn": [ "" ], "equation": "", "from": "10", "text": "", "to": "88" }, "type": "flow" }, "18": { "data": { "dependsOn": [ "" ], "equation": "", "from": "10", "text": "", "to": "74" }, "type": "flow" }, "19": { "data": { "dependsOn": [ "" ], "equation": "", "from": "10", "text": "", "to": "2" }, "type": "flow" }, "20": { "data": { "dependsOn": [ "" ], "equation": "", "from": "21", "text": "", "to": "30" }, "type": "flow" }, "21": { "data": { "initvalue": "", "text": "21", "x": 388, "y": 518 }, "type": "stock" }, "23": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "2" }, "type": "flow" }, "25": { "data": { "initvalue": "", "text": "25", "x": 1028, "y": 203 }, "type": "stock" }, "26": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "72" }, "type": "flow" }, "27": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "8" }, "type": "flow" }, "30": { "data": { "initvalue": "", "text": "30", "x": 180, "y": 448 }, "type": "stock" }, "35": { "data": { "initvalue": "", "text": "35", "x": 1376, "y": 224 }, "type": "stock" }, "40": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "88" }, "type": "flow" }, "43": { "data": { "initvalue": "", "text": "43", "x": 1261, "y": 115 }, "type": "stock" }, "44": { "data": { "initvalue": "", "text": "44", "x": 796, "y": 601 }, "type": "stock" }, "46": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "91" }, "type": "flow" }, "47": { "data": { "initvalue": "", "text": "47", "x": 1309, "y": 427 }, "type": "stock" }, "50": { "data": { "dependsOn": [ "" ], "equation": "", "from": "21", "text": "", "to": "2" }, "type": "flow" }, "55": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "74" }, "type": "flow" }, "56": { "data": { "dependsOn": [ "" ], "equation": "", "from": "10", "text": "", "to": "21" }, "type": "flow" }, "65": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "21" }, "type": "flow" }, "67": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "2" }, "type": "flow" }, "69": { "data": { "dependsOn": [ "" ], "equation": "", "from": "21", "text": "", "to": "88" }, "type": "flow" }, "72": { "data": { "initvalue": "", "text": "72", "x": 1060, "y": 452 }, "type": "stock" }, "74": { "data": { "initvalue": "", "text": "74", "x": 640, "y": 163 }, "type": "stock" }, "77": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "88" }, "type": "flow" }, "78": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "83" }, "type": "flow" }, "82": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "44" }, "type": "flow" }, "83": { "data": { "initvalue": "", "text": "83", "x": 952, "y": 414 }, "type": "stock" }, "84": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "21" }, "type": "flow" }, "85": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "35" }, "type": "flow" }, "87": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "30" }, "type": "flow" }, "88": { "data": { "initvalue": "", "text": "88", "x": 378, "y": 354 }, "type": "stock" }, "89": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "83" }, "type": "flow" }, "91": { "data": { "initvalue": "", "text": "91", "x": 572, "y": 379 }, "type": "stock" }, "93": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "30" }, "type": "flow" }, "95": { "data": { "dependsOn": [ "" ], "equation": "", "from": "91", "text": "", "to": "8" }, "type": "flow" }, "96": { "data": { "dependsOn": [ "" ], "equation": "", "from": "10", "text": "", "to": "30" }, "type": "flow" }, "98": { "data": { "dependsOn": [ "" ], "equation": "", "from": "47", "text": "", "to": "72" }, "type": "flow" } } ] } .

eRedekopp commented 1 year ago

Fixed