reimagined / resolve

Full stack CQRS, DDD, Event Sourcing framework for Node.js

Home Page:https://reimagined.github.io/resolve/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resetting saga in hacker-news example generates redundant events

FreeSlave opened this issue · comments

To Reproduce

  1. Run hacker-news via yarn dev.
  2. Click login and create new account.
  3. In other terminal run yarn module-admin sagas reset UserConfirmation multiple times.
  4. Check the sqlite database, you'll see a number of _RESOLVE_SYS_SCHEDULED_COMMAND_CREATED_ events (depending on how many time you called a reset)

Another (probably related) issue. If you reset SCHEDULER via yarn module-admin sagas reset _SCHEDULER_ before UserRejected is produced, the hacker-news will have unhandled promise rejections afte a while (the number of unhandled rejections depends on the number of UserConfirmation resets).

UnhandledPromiseRejectionWarning: Error: scheduler.execute: unexpected task state "executed"
    at _callee2$ (/home/roman/git_projects/resolve/packages/core/core/lib/saga/create-scheduler-aggregate.js:87:25)
    at tryCatch (/home/roman/git_projects/resolve/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (/home/roman/git_projects/resolve/node_modules/regenerator-runtime/runtime.js:294:22)
    at Generator.next (/home/roman/git_projects/resolve/node_modules/regenerator-runtime/runtime.js:119:21)
    at asyncGeneratorStep (/home/roman/git_projects/resolve/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _next (/home/roman/git_projects/resolve/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
    at /home/roman/git_projects/resolve/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
    at new Promise (<anonymous>)
    at Object.<anonymous> (/home/roman/git_projects/resolve/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
    at Object.execute (/home/roman/git_projects/resolve/packages/core/core/lib/saga/create-scheduler-aggregate.js:107:27)

Can't reproduce anymore. Seems to be fixed in #2176

Fixed in version 0.33.7