Hello!

The WebSharper.Web.Remoting.GetContext uses a ThreadLocal value internally, so it can only work on the same thread that initially calls your RPC function. See the tooltip comment for it. So this is why you had a non-deterministic failure, F# async execution could sometimes switch threads.

Just having let ctx = Web.Remoting.GetContext() outside of the async computation expression should make this work reliably.

By on 1/28/2019 11:05 AM ()

Thank you, great reply! I did see the tooltip but could not put 2 and 2 together. Maybe the tooltip should include the last sentence of your response.

By on 1/28/2019 11:25 AM ()