algorandfoundation / algokit-subscriber-ts

Simple, but flexible / configurable Algorand transaction subscription / indexing mechanism
MIT License
12 stars 6 forks source link

fix: prevent double status calls when calling pollOnce #70

Closed neilcampbell closed 4 months ago

neilcampbell commented 4 months ago

I attempted to implement this as a syncTo feature as discussed here. https://github.com/algorandfoundation/algokit-subscriber-ts/pull/58#issuecomment-2066065152

Unfortunately both getSubscribedTransactions and pollOnce return the currentRound inside TransactionSubscriptionResult. If we wanted to support this properly, we'd need to make a breaking change and ensure the polling processes honour this configuration.

Instead I figured it was better to simply solve the problem at hand, which is preventing double status calls, when using pollOnce, which is what this PR does.