JS: Headers and trailers discarded in unary response

Đang mở
#26 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@lukesandberg đang làm issue này rồi.

Từ ngày 26/8/2021.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

javascript triaged

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();
    }
  };
};
Ngôn ngữ chính
JavaScript
Star
471
Fork
91
Merge trung bình
3 giờ 57 phút
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của protocolbuffers/protobuf-javascript

Tất cả issue của protocolbuffers/protobuf-javascript

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.