Our webrtc implementation with Jitsi as SFU in unified-plan has empty streams in onTrack event

Hi all.
For business need we use our webrtc implementation ( web, android, uwp ) ​that uses Jitsi as SFU.
Jitsi is not presents in our application and to communicate with it we made a proxy in nodejs that talks with SFU and translate sdp into jingle and viceversa. So you can see the messages exachanges like this:

|PEER (sdp)| <-> |PROXY ( translate )| <-> |(jingle) JITSI|

In the past implementation ( with plan-b semantics ) all works well.
Now we’re changing the code of our web application to works with unified-plan so we have introduced the transceivers parts and we have updated jitsi at latest version that support unified-plan.

We have tested 2 our web peer in direct p2p communication with our signaller and without jitsi and we able to see the audio/video stream on both directions.
If we try to start a call from a our web peer to a jitsi web peer we got an exception on jitsi side:

The interested line of code is

but the origin is

After a debugging i found that onTrack is called 4 times and evt.streams is an empty array in the 2 last calls like images below ( image 1 and image 2 are the first 2 calls and evt.streams has 1 stream element with id “mixedmslabel” but in image 3 and 4 ( the last 2 calls ) evt.streams is empty:

(image1 - first call evt.streams has 1 element )

(image2 - second call evt.streams has 1 element )

(image3 - third call evt.streams is empty)

(image4 - fourth call evt.streams is empty)

What’s wrong? Why stream is empty in last 2 calls? We spent severals days to struggle the problem without any solution.
Thanks to anyone who will be interested on this problem.

Solved. In our webrtc implementation we added the stream as parameter of addTrack method and now Jitsi peer can see the streaming from our webrtc implementation.

In the specifics

peerconnection.setRemoteDescription(remote).then(function() {
...
    peerconnection.addTrack(stream.getVideoTracks()[0], stream);
    peerconnection.addTrack(stream.getAudioTracks()[0], stream);
   // where stream is the local stream of getUserMedia

    peerconnection.createAnswer( .... 
...
});