This commit fixes a panic that could occur when registering N subscriptions for N entities of the same kind. Before, when dropping the first of the subscriptions, we would remove the entity ID extractor as well. This was, however, used by all the other N - 1 subscriptions which would then start losing messages. In addition, dropping yet another subscription of that kind would result in a panic, because we wouldn't find the extractor in the map upon invoking `Subscription::drop`. With this change we will avoid removing the ID extractor when dropping a subscription. Crucially, we also avoid inserting extractors for simple message subscriptions. This enables these non-entity subscriptions to be dropped and re-registered without seeing a "registered handler for the same message twice" panic.
Antonio Scandurra committed on 1/11/2022, 7:21:35 AMparent2ea78c5
1 file changedLine totals unavailable