Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Stivenson
    @stivenson
    hi all, a cordial greeting ..
    Mali.js is awesome i have been learn it currently ... :)
    Please, I have a small question:
    I'm trying to check of tests' coverage with mocha, specifically with the command nyc mocha but the results are not correct. Any idea to check the coverage of my mali.js' tests?
    My tests perform calls to the grpc methods.
    Bojan
    @bojand

    Hello, if you just run npm test you should get a coverage report:

    -------------|----------|----------|----------|----------|-------------------|
    File         |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
    -------------|----------|----------|----------|----------|-------------------|
    All files    |    98.93 |    94.12 |    98.48 |    99.18 |                   |
     app.js      |    99.41 |    95.45 |      100 |     99.4 |               323 |
     context.js  |      100 |      100 |      100 |      100 |                   |
     lo.js       |      100 |      100 |      100 |      100 |                   |
     request.js  |      100 |      100 |      100 |      100 |                   |
     response.js |      100 |      100 |      100 |      100 |                   |
     run.js      |    96.36 |    93.75 |    94.74 |    98.11 |                89 |
     utils.js    |    98.55 |    87.27 |      100 |    98.55 |                57 |
    -------------|----------|----------|----------|----------|—————————|

    Coverage is also available online: https://coveralls.io/github/malijs/mali

    Stivenson
    @stivenson
    @bojand oh thanks. I'm going to try adding babel to the coverage, because i'm using ES6 classes in node v10.
    The link is cool...
    Bojan
    @bojand
    hmm not sure i understand… there is no need for babel
    node 10 supports classes
    mali itself does not use babel or any transpiler. it’s plain javascript. what you see is what’s run.
    Stivenson
    @stivenson

    yes, @bojand yo're right, but of moment my coverage is impossible

    auth.js | 0 | 0 | 0 | 0 | 1,3,5,7,8,13 |
    core.js | 0 | 0 | 0 | 0 |... 78,82,86,91,92 |
    giftcard.js | 0 | 0 | 0 | 0 |... 41,42,43,48,53 |

    What might be ? :( i see all fine..

    only an unit-test to a file have the real coverage (it's a test that no use any proto)

    i think so: The coverage is not able to follow the execution of the functions when they are called through proto.
    Bojan
    @bojand
    Hello, not sure I understand tbh… I think I would need more info. If you have like integration / functional tests that’s running requests against a service and you are trying to test coverage of your service, which is running as a separate process, then you probably need to manually instrument your service and run the instrumented code. https://istanbul.js.org/docs/advanced/instrument/
    Stivenson
    @stivenson
    ok @bojand . i'll try its.
    Anh Tu Nguyen
    @xgenvn
    Hi guys, is there any example with typescript?
    Bojan
    @bojand
    Hello, not in the examples repo; there may be some out in the wild that I do not know about.
    Mateusz Tkacz
    @Xardas_gitlab
    Hi. Is there any way to add multiple proto files to server instance? Example: const app = new Mali([PROTO_PATH1, PROTO_PATH2]);
    Bojan
    @bojand
    @Xardas_gitlab Hello yest this should be possible using addService(). Example in tests:
    https://github.com/malijs/mali/blob/master/test/create.test.js#L300
    Mateusz Tkacz
    @Xardas_gitlab
    @bojand This is what i was looking for! Thanks.
    Andrew Watts-Curnow
    @andywatts

    Has anyone got a gRPC keepalive configuration that closes channels after x seconds of failed pings?
    I've tried... 'app.start('0.0.0.0:8080', creds, {"grpc.keepalive_time_ms":1000,"grpc.keepalive_timeout_ms": 2000 })'

    Do I need similar settings in my c# client? TIA

    Bojan
    @bojand

    Hmm these options should be passed properly and handled by underlying node and C++ grpc lib. I don’t have much time to test things out atm, but you could try additional logging on the server, for example:

    GRPC_VERBOSITY=debug GRPC_TRACE=tcp,http,api,timer,timer_check,connectivity_state node myapp.js

    I believe those should capture the ping checks. You can take a look at the available TRACE flags: https://github.com/grpc/grpc/blob/master/doc/environment_variables.md

    Andrew Watts-Curnow
    @andywatts
    @bojan Thankyou
    Andrew Watts-Curnow
    @andywatts
    Any idea how to serve a second health-check service from Mali?
    https://github.com/grpc/grpc/blob/master/doc/health-checking.md
    /doh. Is it as simple as mali.addService...
    Andrew Watts-Curnow
    @andywatts
    Nope, not that simple.
    I think I need to use Grpc server's addService, but can't get gRPC server without starting Mali...and can't add services once started.
    Bojan
    @bojand
    Hi, isn't that just using addService?
    Andrew Watts-Curnow
    @andywatts
    Using the addService method on the grpc server.
    Rather than Mali’s own addService method.
    Joshua Gallagher
    @Joshgallagher
    Could Mali be used with NestJS's gRPC client config? Does anyone forsee any issues with this? I wanted to use NestJS as the Gateway as it's gRPC lacks support for metadata and advanced error handling
    Also, has Mali been used in production anywhere?
    Jingyu
    @washanhanzi
    Mali seems auto convert the snake_case in proto file to CamelCase, however in the route_guide example, the snake_case still being used, I am quite confused. Anyone can help me on this?
    Anon Anon
    @orion3000
    The logger middleware does not work when I am using static code is there a way to fix this?
    amateurobot
    @amateurobot

    how can I access to bytes data?

    syntax = "proto3";
    package com.file;
    
    message FileRequest {
      string title = 1;
      bytes file = 2;
    }
    
    message FileResponse {
      string path = 1;
    }
    
    service FileService {
      rpc SendFile (FileRequest) returns (FileResponse) {}
    }

    and here is the request

    {
      "title": "Hello",
      "file": {
        "type": "Buffer",
        "data": [
          72,
          101,
          108,
          108,
          111
        ]
      }
    }

    I only have access to title in ctx.request.req

    { title: 'Hello' }

    :?

    amateurobot
    @amateurobot
    ok I got it, I've to send the request this way:
    {
      "title": "Hello",
      "file": [
          72,
          101,
          108,
          108,
          111
        ]
    }
    Domas
    @DomasB
    Hi,
    I am using one Mali for one of my projects and noticed that Typescript types are not well supported in the middleware libraries. So I decided to add it starting with @mali/jwt. I created a branch, made the changes, but when trying to push them, I get unable to access 'https://github.com/malijs/jwt.git/': The requested URL returned error: 403. Didn't find any info about contributing. Maybe someone could help? :)
    johnsmithsren
    @johnsmithsren
    hi.i meet a problem , when i use type int64 .in mail , the data become long , like Object.but i want just int . can i handle this by set something to mali
    Nikhil Kumar
    @nikhilmuz
    using app.use({ Testa }) says Error: Unknown method: Testa for service Tester though my proto file has Testa method. any idea?
    Nikhil Kumar
    @nikhilmuz
    My bad seems proto loader with gRPC library doesn't work anymore
    We have to use separate proto loader and the old version of mali still try to load using gRPC library
    ChosenQuill
    @ChosenQuill
    Hey guys! I'm wondering how you guys are creating the clients for mali. Using plain grpc or another library?
    Nikhil Kumar
    @nikhilmuz
    When using sequential middleware like
    app.use(middleware1); app.use(middleware2);
    The call returns when any async function is called in sequential middleware. First one works fine.
    sciento
    @sciento
    Hey guys, what's the best way to test a MaliServer?
    Nikhil Kumar
    @nikhilmuz
    Use BloomRPC
    sciento
    @sciento
    Thanks, but i wanna a solution for automated testing. Like mocha+chai.
    Nikhil Kumar
    @nikhilmuz
    Then write js RPC client. It won’t be much line of code as it will be just function calls
    sciento
    @sciento
    Ok, i will try it. Thank you very much @nikhilmuz :-) Greetings form Germany!
    Nikhil Kumar
    @nikhilmuz
    It’s okay! I think this gitter thread is dead. I also use mali for production here in India but not got any support from here yet. I literally have to refer whole mali code to debug issues sometimes😂
    sciento
    @sciento
    :D
    abgr
    @itsabgr
    Use wombat for grpc tests
    i used mali in production i love it
    made my road flat
    but it needs to port sharing and tls support