samyun / southwest-price-drop-bot

Bot that watches Southwest flights for price drops.
Other
74 stars 41 forks source link

fix: Uses newer lodash version for history graph deep clone #56

Closed ribordy closed 4 years ago

ribordy commented 4 years ago

Fixes #55. ~I don't have a full understanding of the surrounding code, but the error I was getting seemed to be due to lodash's cloneDeep method not playing nicely with the CoreMongoose Array that we're now working with. Creating an array from that CoreMongoose array allows lodash to play nicely with it. Array.from only does a shallow clone, so we still need to deeply clone it before mucking with it to display the graph.~

@brussrus pointed out that the lodash.clonedeep module was using an older version of lodash (4.5). The project was already bundling lodash (4.17) via other dependencies, so I made that dependency explicit and used that instead of the old one. Long-term it might make sense to fully remove the lodash.clonedeep dependency, I think it's only used in one place.

ribordy commented 4 years ago

This is up and running on my instance, seems to be working fine.