GithubHelp home page GithubHelp logo

Comments (6)

ibc avatar ibc commented on May 29, 2024 1

Ok, I was under the impression that you need this done to verify tests in flatbuffers. If not, let's wait.

from mediasoup.

jmillan avatar jmillan commented on May 29, 2024 1

So I cannot reproduce the error. I mean, I've literally make safeEmit() behave as emit() (no try/catch) and the tests succeed ¯_(ツ)_/¯

@jmillan what do I need to reproduce the problem? you remember?

As said in the description, write expect(1).toBe(2) in an even handler. The test will pass, and it should not.

from mediasoup.

ibc avatar ibc commented on May 29, 2024

We should only use safeEmit() in internal listeners and never use it in public events. The app is free to add try/catch into its listeners.

NOTE: Same must be done in mediasoup-client and mediasoup-aiortc-client.

NOTE: Let's do this directly in flatbuffers.

from mediasoup.

jmillan avatar jmillan commented on May 29, 2024

NOTE: Let's do this directly in flatbuffers.

I have just discovered this issue that has always been there. Can we wait for flatbuffers to be moved to v3 and do it then?

It will be impossible for anyone to look at the PR otherwise.

I don't find this being so urgent. We can do it as soon as flatbuffers is merged.

from mediasoup.

ibc avatar ibc commented on May 29, 2024

So I cannot reproduce the error. I mean, I've literally make safeEmit() behave as emit() (no try/catch) and the tests succeed ¯_(ツ)_/¯

@jmillan what do I need to reproduce the problem? you remember?

from mediasoup.

ibc avatar ibc commented on May 29, 2024

Well, that's the thing: if I add this in the test file:

dataConsumer.on('message', (message, ppid) =>
{
  // current code

  expect(1).toBe(2);
});

then I see that those listeners are failing due to the new emittererror event. The thing is that I do NOT see any other error, meaning that all the other expect() are NOT failing!

  console.log
    ------ dataConsumer listener error [eventName:message]: Error: expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 1

      at DataConsumer.<anonymous> (node/src/tests/test-DirectTransport.ts:150:11)

        at DataConsumer.<anonymous> (node/src/tests/test-DirectTransport.ts:235:12)

  console.log
    ------ dataConsumer listener error [eventName:message]: Error: expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 1

      at DataConsumer.<anonymous> (node/src/tests/test-DirectTransport.ts:150:11)

 PASS  node/src/tests/test-DirectTransport.ts
  ✓ router.createDirectTransport() succeeds (11 ms)
  ✓ router.createDirectTransport() with wrong arguments rejects with TypeError (26 ms)
  ✓ directTransport.getStats() succeeds (4 ms)
  ✓ directTransport.connect() succeeds (1 ms)
  ✓ dataProducer.send() succeeds (249 ms)
  ✓ dataProducer.send() with subchannels succeeds (5 ms)
  ✓ DirectTransport methods reject if closed (6 ms)
  ✓ DirectTransport emits "routerclose" if Router is closed (2 ms)
  ✓ DirectTransport emits "routerclose" if Worker is closed (2 ms)

Test Suites: 1 passed, 1 total
Tests:       9 passed, 9 total
Snapshots:   0 total
Time:        3.067 s
Ran all test suites matching /tests\/test-DirectTransport.ts/i.

from mediasoup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.