@gravity-ui/gateway 4.10.2 → 4.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/grpc.js +2 -1
- package/build/index.js +6 -4
- package/package.json +1 -1
package/build/components/grpc.js
CHANGED
|
@@ -157,6 +157,7 @@ const reflectionServiceInstancesMap = {};
|
|
|
157
157
|
function clearInstancesCache(service, instancesMap, cachePath, closeTimeout, ctx) {
|
|
158
158
|
const cachedService = lodash_1.default.get(instancesMap, cachePath);
|
|
159
159
|
if (cachedService !== service) {
|
|
160
|
+
ctx.log(`Service client not matched cached service for cachePath '${cachePath}'`);
|
|
160
161
|
return;
|
|
161
162
|
}
|
|
162
163
|
// Remove cached service instance
|
|
@@ -677,7 +678,7 @@ function createGrpcAction({ root, credentials }, endpoints, config, serviceKey,
|
|
|
677
678
|
((_b = (_a = options.grpcRetryCondition) === null || _a === void 0 ? void 0 : _a.call(options, error)) !== null && _b !== void 0 ? _b : (0, grpc_1.isRetryableGrpcError)(error));
|
|
678
679
|
if (shouldRecreateService) {
|
|
679
680
|
ctx.log(`Service client for ${config.protoKey} is going to be re-created`);
|
|
680
|
-
recreateService(service,
|
|
681
|
+
recreateService(service, 5000, ctx, args);
|
|
681
682
|
}
|
|
682
683
|
if (shouldRetry) {
|
|
683
684
|
(0, common_2.handleError)(ErrorConstructor, error, ctx, `Request failed, retrying ${retries--} more times`, {
|
package/build/index.js
CHANGED
|
@@ -117,7 +117,7 @@ function generateGatewayApi(schema, config, grpcContext, baseApi) {
|
|
|
117
117
|
function generateGatewayApiController(schemasByScope, Api, config, controllerActions) {
|
|
118
118
|
// eslint-disable-next-line complexity
|
|
119
119
|
return async function gateway(req, res) {
|
|
120
|
-
var _a, _b, _c, _d;
|
|
120
|
+
var _a, _b, _c, _d, _e;
|
|
121
121
|
const { userId } = res.locals || {};
|
|
122
122
|
const { service, action, scope = 'root' } = req.params;
|
|
123
123
|
const withDebugHeaders = typeof config.withDebugHeaders === 'function'
|
|
@@ -227,13 +227,15 @@ function generateGatewayApiController(schemasByScope, Api, config, controllerAct
|
|
|
227
227
|
else {
|
|
228
228
|
responseError = lodash_1.default.omit(error, ['debug']);
|
|
229
229
|
// Remove DebugInfo
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
const grpcDetails = (_e = responseError.details) === null || _e === void 0 ? void 0 : _e.details;
|
|
231
|
+
if (grpcDetails) {
|
|
232
|
+
lodash_1.default.forEach(grpcDetails, function (value, key) {
|
|
232
233
|
const DEBUG_INFO_TYPE = 'type.googleapis.com/google.rpc.DebugInfo';
|
|
233
234
|
if ((value === null || value === void 0 ? void 0 : value['@type']) === DEBUG_INFO_TYPE) {
|
|
234
|
-
|
|
235
|
+
grpcDetails[key] = undefined;
|
|
235
236
|
}
|
|
236
237
|
});
|
|
238
|
+
responseError.details.details = grpcDetails.filter(Boolean);
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
241
|
if (onRequestFailed) {
|