Currently, when serverAnonymisation is set in the Emitter, the whole OkHttpNetworkConnection is recreated. This is slow, so there can be a delay in setting the anonymising SP-Anonymous header.
This change sets the serverAnonymisation directly in OkHttpNetworkConnection. Now the opposite is true - some events tracked just before the flag was set can end up with the SP-Anonymous header if they're still being processed when the change is made.
NB: the CI tests for API 30 are currently failing due to flakiness. This is a known problem and will be addressed in a future PR.
For issue #688
Currently, when
serverAnonymisation
is set in theEmitter
, the wholeOkHttpNetworkConnection
is recreated. This is slow, so there can be a delay in setting the anonymisingSP-Anonymous
header.This change sets the
serverAnonymisation
directly inOkHttpNetworkConnection
. Now the opposite is true - some events tracked just before the flag was set can end up with theSP-Anonymous
header if they're still being processed when the change is made.NB: the CI tests for API 30 are currently failing due to flakiness. This is a known problem and will be addressed in a future PR.