@vertexvis/viewer 1.0.2-canary.19 → 1.0.2-canary.20
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/dist/cjs/{controller-C-I_MLA3.js → controller-CMJs6F-h.js} +80 -32
- package/dist/{esm/controller-CwTBp6Da.js.map → cjs/controller-CMJs6F-h.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +1 -1
- package/dist/collection/components/scene-tree/lib/controller.js +48 -30
- package/dist/collection/components/scene-tree/lib/controller.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-ZaEgtA4a.js → p-B7C1GfGS.js} +2 -2
- package/dist/components/p-BNfR95Px.js +5 -0
- package/dist/components/{p-C-Bg5fev.js.map → p-BNfR95Px.js.map} +1 -1
- package/dist/components/vertex-scene-tree.js +1 -1
- package/dist/components/vertex-viewer-pin-group.js +1 -1
- package/dist/components/vertex-viewer-pin-tool.js +1 -1
- package/dist/esm/{controller-CwTBp6Da.js → controller-vXSti_qr.js} +81 -33
- package/dist/{cjs/controller-C-I_MLA3.js.map → esm/controller-vXSti_qr.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/vertex-scene-tree.entry.js +1 -1
- package/dist/esm/vertex-viewer-pin-group.entry.js +1 -1
- package/dist/types/components/scene-tree/lib/controller.d.ts +2 -0
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/{p-a50a1924.entry.js → p-4b5a62da.entry.js} +2 -2
- package/dist/viewer/{p-182294df.entry.js → p-61188ccc.entry.js} +2 -2
- package/dist/viewer/p-BNfR95Px.js +5 -0
- package/dist/viewer/{p-C-Bg5fev.js.map → p-BNfR95Px.js.map} +1 -1
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +10 -10
- package/dist/components/p-C-Bg5fev.js +0 -5
- package/dist/viewer/p-C-Bg5fev.js +0 -5
- /package/dist/components/{p-ZaEgtA4a.js.map → p-B7C1GfGS.js.map} +0 -0
- /package/dist/viewer/{p-a50a1924.entry.js.map → p-4b5a62da.entry.js.map} +0 -0
- /package/dist/viewer/{p-182294df.entry.js.map → p-61188ccc.entry.js.map} +0 -0
|
@@ -2703,7 +2703,8 @@ function requireScene_tree_api_pb () {
|
|
|
2703
2703
|
var f, obj = {
|
|
2704
2704
|
viewId: (f = msg.getViewId()) && core_protos_uuid_pb.Uuid.toObject(includeInstance, f),
|
|
2705
2705
|
pager: (f = msg.getPager()) && core_protos_paging_pb.OffsetPager.toObject(includeInstance, f),
|
|
2706
|
-
additionalColumnKeysList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f
|
|
2706
|
+
additionalColumnKeysList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
|
|
2707
|
+
requireViewReady: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
|
|
2707
2708
|
};
|
|
2708
2709
|
|
|
2709
2710
|
if (includeInstance) {
|
|
@@ -2754,6 +2755,10 @@ function requireScene_tree_api_pb () {
|
|
|
2754
2755
|
var value = /** @type {string} */ (reader.readString());
|
|
2755
2756
|
msg.addAdditionalColumnKeys(value);
|
|
2756
2757
|
break;
|
|
2758
|
+
case 4:
|
|
2759
|
+
var value = /** @type {boolean} */ (reader.readBool());
|
|
2760
|
+
msg.setRequireViewReady(value);
|
|
2761
|
+
break;
|
|
2757
2762
|
default:
|
|
2758
2763
|
reader.skipField();
|
|
2759
2764
|
break;
|
|
@@ -2806,6 +2811,13 @@ function requireScene_tree_api_pb () {
|
|
|
2806
2811
|
f
|
|
2807
2812
|
);
|
|
2808
2813
|
}
|
|
2814
|
+
f = message.getRequireViewReady();
|
|
2815
|
+
if (f) {
|
|
2816
|
+
writer.writeBool(
|
|
2817
|
+
4,
|
|
2818
|
+
f
|
|
2819
|
+
);
|
|
2820
|
+
}
|
|
2809
2821
|
};
|
|
2810
2822
|
|
|
2811
2823
|
|
|
@@ -2920,6 +2932,24 @@ function requireScene_tree_api_pb () {
|
|
|
2920
2932
|
};
|
|
2921
2933
|
|
|
2922
2934
|
|
|
2935
|
+
/**
|
|
2936
|
+
* optional bool require_view_ready = 4;
|
|
2937
|
+
* @return {boolean}
|
|
2938
|
+
*/
|
|
2939
|
+
proto.vertexvis.protobuf.scenetree.v1alpha1.GetTreeRequest.prototype.getRequireViewReady = function() {
|
|
2940
|
+
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
|
2941
|
+
};
|
|
2942
|
+
|
|
2943
|
+
|
|
2944
|
+
/**
|
|
2945
|
+
* @param {boolean} value
|
|
2946
|
+
* @return {!proto.vertexvis.protobuf.scenetree.v1alpha1.GetTreeRequest} returns this
|
|
2947
|
+
*/
|
|
2948
|
+
proto.vertexvis.protobuf.scenetree.v1alpha1.GetTreeRequest.prototype.setRequireViewReady = function(value) {
|
|
2949
|
+
return jspb.Message.setProto3BooleanField(this, 4, value);
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
|
|
2923
2953
|
|
|
2924
2954
|
/**
|
|
2925
2955
|
* List of repeated fields within this message type.
|
|
@@ -6885,25 +6915,23 @@ class SceneTreeController {
|
|
|
6885
6915
|
* @param index A 0 based index to fetch.
|
|
6886
6916
|
*/
|
|
6887
6917
|
async fetchPage(index) {
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
}
|
|
6906
|
-
});
|
|
6918
|
+
if (index < 0 || index > this.maxPages - 1) {
|
|
6919
|
+
return;
|
|
6920
|
+
}
|
|
6921
|
+
if (!this.pages.has(index)) {
|
|
6922
|
+
const offset = index * this.rowLimit;
|
|
6923
|
+
this.log('Scene tree fetching page', index, offset);
|
|
6924
|
+
const res = this.fetchTree(offset, this.rowLimit, () => this.ifConnectionHasJwt((jwt) => jwt));
|
|
6925
|
+
const id = this.nextPageId++;
|
|
6926
|
+
const page = { id, res, index, metadataKeys: this.metadataKeys };
|
|
6927
|
+
this.pages.set(index, page);
|
|
6928
|
+
page.done = this.handlePageResult(page);
|
|
6929
|
+
}
|
|
6930
|
+
const page = this.pages.get(index);
|
|
6931
|
+
const [resResult] = await Promise.allSettled([page === null || page === void 0 ? void 0 : page.res, page === null || page === void 0 ? void 0 : page.done]);
|
|
6932
|
+
if ((resResult === null || resResult === void 0 ? void 0 : resResult.status) === 'rejected') {
|
|
6933
|
+
throw resResult.reason;
|
|
6934
|
+
}
|
|
6907
6935
|
}
|
|
6908
6936
|
/**
|
|
6909
6937
|
* Fetches a page that contains the given row offset.
|
|
@@ -7325,16 +7353,34 @@ class SceneTreeController {
|
|
|
7325
7353
|
const pageEnd = this.getPageForOffset(end);
|
|
7326
7354
|
return [pageStart, pageEnd];
|
|
7327
7355
|
}
|
|
7328
|
-
async fetchTree(offset, limit,
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7356
|
+
async fetchTree(offset, limit, jwtProvider, currentAttempt = 1) {
|
|
7357
|
+
const maxAttempts = SceneTreeController.MAX_GET_TREE_ATTEMPTS;
|
|
7358
|
+
try {
|
|
7359
|
+
const jwt = await jwtProvider();
|
|
7360
|
+
return await this.requestUnary(jwt, (metadata, handler) => {
|
|
7361
|
+
const pager = new errors.paging_pbExports.OffsetPager();
|
|
7362
|
+
pager.setOffset(offset);
|
|
7363
|
+
pager.setLimit(limit);
|
|
7364
|
+
const req = new scene_tree_api_pbExports.GetTreeRequest();
|
|
7365
|
+
req.setPager(pager);
|
|
7366
|
+
req.setAdditionalColumnKeysList(this.metadataKeys);
|
|
7367
|
+
req.setRequireViewReady(true);
|
|
7368
|
+
this.client.getTree(req, metadata, handler);
|
|
7369
|
+
});
|
|
7370
|
+
}
|
|
7371
|
+
catch (error) {
|
|
7372
|
+
if (!isGrpcServiceError(error) || error.code !== wrappers_pb.grpcWebClient_umdExports.grpc.Code.Unavailable) {
|
|
7373
|
+
throw error;
|
|
7374
|
+
}
|
|
7375
|
+
if (currentAttempt >= maxAttempts) {
|
|
7376
|
+
throw new Error(`Failed to retrieve scene tree after ${maxAttempts} attempts.`);
|
|
7377
|
+
}
|
|
7378
|
+
const delay = SceneTreeController.GET_TREE_RETRY_DELAYS_IN_MS[currentAttempt - 1];
|
|
7379
|
+
const nextAttempt = currentAttempt + 1;
|
|
7380
|
+
console.warn(`GetTree failed because the view is not ready. Retrying in ${delay}ms (attempt ${nextAttempt}/${maxAttempts}).`);
|
|
7381
|
+
await bundle.async.delay(delay);
|
|
7382
|
+
return this.fetchTree(offset, limit, jwtProvider, nextAttempt);
|
|
7383
|
+
}
|
|
7338
7384
|
}
|
|
7339
7385
|
// TODO(dan): used shared grpc lib
|
|
7340
7386
|
requestUnary(jwt, req) {
|
|
@@ -7436,11 +7482,13 @@ class SceneTreeController {
|
|
|
7436
7482
|
SceneTreeController.IDLE_RECONNECT_IN_SECONDS = 4 * 60;
|
|
7437
7483
|
SceneTreeController.LOST_CONNECTION_RECONNECT_IN_SECONDS = 2;
|
|
7438
7484
|
SceneTreeController.MAX_SUBSCRIPTION_RETRY_COUNT = 2;
|
|
7485
|
+
SceneTreeController.MAX_GET_TREE_ATTEMPTS = 6;
|
|
7486
|
+
SceneTreeController.GET_TREE_RETRY_DELAYS_IN_MS = [1000, 2000, 4000, 8000, 15000];
|
|
7439
7487
|
|
|
7440
7488
|
exports.SceneTreeController = SceneTreeController;
|
|
7441
7489
|
exports.SceneTreeErrorDetails = SceneTreeErrorDetails;
|
|
7442
7490
|
exports.scene_tree_api_pb_serviceExports = scene_tree_api_pb_serviceExports;
|
|
7443
7491
|
exports.webSocketSubscriptionTransportFactory = webSocketSubscriptionTransportFactory;
|
|
7444
|
-
//# sourceMappingURL=controller-
|
|
7492
|
+
//# sourceMappingURL=controller-CMJs6F-h.js.map
|
|
7445
7493
|
|
|
7446
|
-
//# sourceMappingURL=controller-
|
|
7494
|
+
//# sourceMappingURL=controller-CMJs6F-h.js.map
|