mattkrick / redux-optimistic-ui

a reducer enhancer to enable type-agnostic optimistic updates
MIT License
693 stars 36 forks source link

Fix issue with commit/revert of invalid transaction id #33

Closed marcins closed 7 years ago

marcins commented 7 years ago

A bug exists where the check for an invalid transaction id comes too late, which means that the check actually does find an action with that transaciton id - the invalid one that was just pushed.

The fix is to check whether the transaction id is valid earlier, and throw an Error (rather than just logging it).

coveralls commented 7 years ago

Coverage Status

Coverage increased (+7.7%) to 100.0% when pulling 911c33b7d5d4226df6ef50fd8099efcf79a23614 on marcins:bugfix/32-invalid-id-fix into 91b0dea12c9d056c19ebc021f45d377f8f08ff26 on mattkrick:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+7.7%) to 100.0% when pulling 911c33b7d5d4226df6ef50fd8099efcf79a23614 on marcins:bugfix/32-invalid-id-fix into 91b0dea12c9d056c19ebc021f45d377f8f08ff26 on mattkrick:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+7.7%) to 100.0% when pulling 66302e84fa3b9c2bb1c92f6f8d7929d8654f2c36 on marcins:bugfix/32-invalid-id-fix into 91b0dea12c9d056c19ebc021f45d377f8f08ff26 on mattkrick:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+7.7%) to 100.0% when pulling 66302e84fa3b9c2bb1c92f6f8d7929d8654f2c36 on marcins:bugfix/32-invalid-id-fix into 91b0dea12c9d056c19ebc021f45d377f8f08ff26 on mattkrick:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+7.7%) to 100.0% when pulling 66302e84fa3b9c2bb1c92f6f8d7929d8654f2c36 on marcins:bugfix/32-invalid-id-fix into 91b0dea12c9d056c19ebc021f45d377f8f08ff26 on mattkrick:master.

mattkrick commented 7 years ago

thanks for the PR! and sorry for the delay, i guess i unwatched this repo & didn't get any notifications.

yeah, throwing is probably better here, will merge.