In case someone wishes to fix this issue, this is what I realised and how I fixed it.
It seems like the client doesn’t get around to flushing everything properly before the command finishes. I’m not 100% sure about the internals, but my fix makes me feel that it’s related to that.
In $this->trackingService
(which is a wrapper for the linked client) I added a function called forceFlush()
which just calls Segment::flush()
. I call this method at the end of the try-catch in the execute
method.
As soon as this is called, all the expected values appear in segment.
CLICK HERE to find out more related problems solutions.