fudgebucket27 / Lexplorer

Loopring explorer alternative
14 stars 10 forks source link

object disposed exception when viewing a new page in collection view #209

Closed fudgebucket27 closed 2 years ago

fudgebucket27 commented 2 years ago

When I click to view the next page on a collection: https://lexplorer-dev.azurewebsites.net/nfts/collections/0xeb06a2fe3f2673526935213ef2267c26b900002f I get an exception about the cancellation token being disposed:

Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: The CancellationTokenSource has been disposed.

System.ObjectDisposedException: The CancellationTokenSource has been disposed.

Reloading the page after the exception will bring up the requested page

modersohn commented 2 years ago

That took me a while to figure out!

We rely on the Interlocked.Exchange at the end to set cts back to null. But this isn't called when we return early because something wasn't yet set. Will no find a way to make sure this is always called and check other call sites too.