@vuu-ui/vuu-data-remote 5.0.0-alpha.3 → 5.0.0-alpha.5
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.0.0-alpha.
|
|
2
|
+
"version": "5.0.0-alpha.5",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@vuu-ui/vuu-data-types": "5.0.0-alpha.
|
|
15
|
-
"@vuu-ui/vuu-table-types": "5.0.0-alpha.
|
|
16
|
-
"@vuu-ui/vuu-filter-types": "5.0.0-alpha.
|
|
17
|
-
"@vuu-ui/vuu-protocol-types": "5.0.0-alpha.
|
|
14
|
+
"@vuu-ui/vuu-data-types": "5.0.0-alpha.5",
|
|
15
|
+
"@vuu-ui/vuu-table-types": "5.0.0-alpha.5",
|
|
16
|
+
"@vuu-ui/vuu-filter-types": "5.0.0-alpha.5",
|
|
17
|
+
"@vuu-ui/vuu-protocol-types": "5.0.0-alpha.5"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@vuu-ui/vuu-filter-parser": "5.0.0-alpha.
|
|
21
|
-
"@vuu-ui/vuu-utils": "5.0.0-alpha.
|
|
22
|
-
"@vuu-ui/vuu-data-editing": "5.0.0-alpha.
|
|
20
|
+
"@vuu-ui/vuu-filter-parser": "5.0.0-alpha.5",
|
|
21
|
+
"@vuu-ui/vuu-utils": "5.0.0-alpha.5",
|
|
22
|
+
"@vuu-ui/vuu-data-editing": "5.0.0-alpha.5"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"README.md",
|
package/src/VuuDataSource.js
CHANGED
|
@@ -107,6 +107,7 @@ class VuuDataSource extends BaseDataSource {
|
|
|
107
107
|
else {
|
|
108
108
|
if (infoEnabled && "viewport-update" === message.type) info(`handleMessageFromServer<viewport-update> range (${message.range?.from}:${message.range?.to}) rows ${message.rows?.at(0)?.[0]} - ${message.rows?.at(-1)?.[0]}`);
|
|
109
109
|
this._clientCallback?.(message);
|
|
110
|
+
if ("subscribe-failed" === message.type && this.#sourceTableDataSource) this.unsubscribe(false);
|
|
110
111
|
}
|
|
111
112
|
if ("debounce" === this.optimize) this.revertDebounce();
|
|
112
113
|
}
|
|
@@ -121,17 +122,18 @@ class VuuDataSource extends BaseDataSource {
|
|
|
121
122
|
this._clientCallback?.(msg);
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
|
-
unsubscribe() {
|
|
125
|
+
unsubscribe(notifyServer = true) {
|
|
125
126
|
if ("unsubscribed" !== this.#status) {
|
|
126
127
|
info?.(`unsubscribe #${this.viewport}`);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
const viewport = this.viewport;
|
|
129
|
+
this.#status = "unsubscribed";
|
|
130
|
+
if (viewport) {
|
|
131
|
+
if (notifyServer) this.server?.unsubscribe(viewport);
|
|
132
|
+
this.emit("unsubscribed", viewport);
|
|
130
133
|
}
|
|
131
|
-
this.server?.destroy(
|
|
134
|
+
this.server?.destroy(viewport);
|
|
132
135
|
this.server = null;
|
|
133
136
|
this.removeAllListeners();
|
|
134
|
-
this.#status = "unsubscribed";
|
|
135
137
|
this.viewport = "";
|
|
136
138
|
this.range = Range(0, 0);
|
|
137
139
|
}
|
|
@@ -92,8 +92,16 @@ class ServerProxy {
|
|
|
92
92
|
if ("" === this.authToken) server_proxy_error("login, cannot login until auth token has been obtained");
|
|
93
93
|
}
|
|
94
94
|
clearAllViewports() {
|
|
95
|
-
this.viewports.forEach((viewport)=>{
|
|
96
|
-
viewport.
|
|
95
|
+
this.viewports.forEach((viewport, key)=>{
|
|
96
|
+
if (isSessionTable(viewport.table)) {
|
|
97
|
+
this.mapClientToServerViewport.delete(viewport.clientViewportId);
|
|
98
|
+
this.viewports.delete(key);
|
|
99
|
+
this.postMessageToClient({
|
|
100
|
+
clientViewportId: viewport.clientViewportId,
|
|
101
|
+
type: "subscribe-failed",
|
|
102
|
+
msg: `session table ${viewport.table.table} disconnected`
|
|
103
|
+
});
|
|
104
|
+
} else viewport.clearCache();
|
|
97
105
|
});
|
|
98
106
|
}
|
|
99
107
|
disconnect() {
|
package/types/VuuDataSource.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class VuuDataSource extends BaseDataSource implements DataSourceB
|
|
|
14
14
|
subscribe(subscribeProps: DataSourceSubscribeProps, callback: DataSourceSubscribeCallback): Promise<void>;
|
|
15
15
|
handleMessageFromServer: (message: DataSourceCallbackMessage) => void;
|
|
16
16
|
handleSessionMessageFromServer: (msg: DataSourceCallbackMessage) => void;
|
|
17
|
-
unsubscribe(): void;
|
|
17
|
+
unsubscribe(notifyServer?: boolean): void;
|
|
18
18
|
suspend(escalateToDisable?: boolean, escalateDelay?: number | undefined): void;
|
|
19
19
|
/**
|
|
20
20
|
* Tell the server we wish to resume receiving messages. Server will send a
|