hello, I'm trying to figure out the proper way to ...
# coroutines
d
hello, I'm trying to figure out the proper way to do interop between reactor and coroutines - I need to populate reactor subscriber context with value computed from coroutine.
g
Probably make sense to ask in #spring or check their implementation, as I remember the last versions of Spring provide some integration with reactor context for coroutines
💯 1
d
yeah already did and waiting for response
w
Latest spring supports coroutines and should not require special interop
d
also as a side note -> that webfilter logic does seem to work fine as when i start the spring boot app it properly populates it
d
might be just unit test
yeah it "should" work 🙂
g
I'm not familiar with reactor, but curious what kind integration so you need, what you want to achieve
d
well i'm trying to have some unit test for verifying the context is populated right
so that step verifier tests worked fine when i used regular method to calculate value to be stored in the reactor subscriber context
but unfortunately it broke when i moved to coroutines
it does seem like an issue with reactor step verifier
to complete the thread -> so the issue was that step verifier attempts to verify the context on the result of the filter mono chain. Since final value is not yet computed there is nothing yet added to the context so the StepVerifier checks against the context will fail. Unit test fix was to manually capture the context in the reactor chain and then complete it before attempting to verify the context (https://github.com/ExpediaGroup/graphql-kotlin/pull/361/commits/f746a886ddd97fa11dd29badecc8d7014d6fc75c)