protocolbuffers / protocolbuffers/protobuf-javascript

JS: Headers and trailers discarded in unary response

Aperta
#26 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@lukesandberg ci sta già lavorando.

Dal 26/8/2021.

javascript triaged
Lingua principale
JavaScript
Stelle
471
Fork
91
Merge medio
3h 57m
PR unite (30g)
2

Descrizione

What version of protobuf and what language are you using?
Version: libprotoc 3.12.0
Language: Javascript

What operating system (Linux, Windows, ...) and version?
Manjaro linux

What runtime / compiler are you using (e.g., python version or gcc version)
protoc-gen-grpc-web + protobuf manjaro package

What did you do?
protoc socket.proto --js_out=import_style=commonjs,binary:src/client --ts_out=service=grpc-web:src/client

What did you expect to see
Pass response callback headers and trailers

What did you see instead?

SocketClient.prototype.connect = function connect(requestMessage, metadata, callback) {
  if (arguments.length === 2) {
    callback = arguments[1];
  }
  var client = grpc.unary(Socket.connect, {
    request: requestMessage,
    host: this.serviceHost,
    metadata: metadata,
    transport: this.options.transport,
    debug: this.options.debug,
    onEnd: function (response) {
      if (callback) {
        if (response.status !== grpc.Code.OK) {
          var err = new Error(response.statusMessage);
          err.code = response.status;
          err.metadata = response.trailers;
          callback(err, null);
        } else {
          callback(null, response.message); <-- no headers or trailers
        }
      }
    }
  });
  return {
    cancel: function () {
      callback = null;
      client.close();
    }
  };
};

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.