This PR is motivated by discussion #379. It is not clear that it fixes any bug, because we have not identified a bug: We have not been able to reproduce the issue reported by the user. All my tests — both automated unit tests and manual end-to-end tests — behaved the same way before and after this PR.
Having said that, the added logic in this PR fends off against some theoretical speculation of what might happen in some corner cases. See other comments for more details.
This PR is motivated by discussion #379. It is not clear that it fixes any bug, because we have not identified a bug: We have not been able to reproduce the issue reported by the user. All my tests — both automated unit tests and manual end-to-end tests — behaved the same way before and after this PR.
Having said that, the added logic in this PR fends off against some theoretical speculation of what might happen in some corner cases. See other comments for more details.