Closed zerc closed 1 year ago
If there are no previous transitions then nil will be returned and it should be cached. Otherwise, during the initial transition multiple database queries will be made to get the last transition (which doesn't exist).
nil
See https://github.com/gocardless/statesman/issues/504 for more details
Can you please add a test case that fails without this PR and passes with?
I can't see how this makes any meaningful difference in behaviour
@Tabby I've added the test and some comments to clarify the problem.
Context
If there are no previous transitions then
nil
will be returned and it should be cached. Otherwise, during the initial transition multiple database queries will be made to get the last transition (which doesn't exist).See https://github.com/gocardless/statesman/issues/504 for more details