seagull-js / seagull

the core of the seagull framework
https://seagull-js.github.io/seagull/
GNU Lesser General Public License v3.0
10 stars 5 forks source link

commands-mode-copy-fix #126

Closed cpa-gecko closed 5 years ago

cpa-gecko commented 5 years ago

mode should be copied instead of referenced. this could lead to race conditions

codeclimate[bot] commented 5 years ago

Code Climate has analyzed commit cde1c36c and detected 0 issues on this pull request.

View more on Code Climate.

Harper04 commented 5 years ago

did we have one?; do we still use commands where this matters?

originally we wanted to force new modes globally during runtime; if you need to override that you could just set a new mode (the singleton properties were readonly; not the property of the class so you could just set a new one.)

if that changed: I'm fine

cpa-gecko commented 5 years ago

you're right, the issue is not as important anymore, since we moved away from using commands for data. still, with the mode reference could lead to a command starting with one mode and ending with another (e.g. when implementing async code like fetching data). and the fix is rather trivial ... :)