derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 116 forks source link

Fix var reference error within Model.unload() and add regression tests. #296

Closed distracteddev closed 1 year ago

distracteddev commented 1 year ago

Context

Previously, when calling Model.unload(), we were accidentally iterating over the properties of a CounterMap rather than iterating over the keys within the CounterMap.

Changes

ericyhwang commented 1 year ago

Good find, and thanks for writing tests to verify the issue's fixed!

This issue was introduction with the creation of CounterMap: https://github.com/derbyjs/racer/commit/0cb0bf2a2114f2c41432163b7824d791cfa4f34b#diff-e786030b6c8e8ddf44d387d7af5a48e3bb45c7898cb52f06c1452f2903d82ab5R117