You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm updating from 2.10.0 to 3.1.3 and running into an lifecycle issue. There used to be eject_table and host_table methods which handled cleanup when replacing datasets purely on the server. Without those, I'm running into an issue where it seems I have to handle view/table cleanup on the client. (Note: this may have always been the case and I wasn't properly cleaning up views and it's now just more obvious in 3.0).
Reading the docs about the Node.js backend detailed here it says that when you use await websocket.open_table("table_one"); the "table and view objects live on the server."
Here is the example from the docs:
const{ WebSocketServer, table }=require("@finos/perspective");constfs=require("fs");// Start a WS/HTTP host on port 8080. The `assets` property allows// the `WebSocketServer()` to also serves the file structure rooted in this// module's directory.consthost=newWebSocketServer({assets: [__dirname],port: 8080});// Read an arrow file from the file system and host it as a named table.constarr=fs.readFileSync(__dirname+"/superstore.lz4.arrow");awaittable(arr,{name: "table_one"});
I can keep track of a reference to the table object returned by await table but when I call .delete() on this object, it says I have views that depend on it and it throws an error.
On the client, I can call elem.getView() and elem.getTable() and delete the returned objects and that works but I get the following warning:
00960502:0x18cc90 WARN _viewer::session::view_subscription:169 View dropped without calling `delete()`
warn @ client.js?v=f4f1a4ff:2675
n.wbg.__wbg_warn_5d3f783b0bae8943 @ @finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:1690
$func6359 @ 00960502:0x18cc90
$func477 @ 00960502:0x7c14c
$func4741 @ 00960502:0x17612c
$func2334 @ 00960502:0x1235f9
$func4670 @ 00960502:0x173343
$func8240 @ 00960502:0x1f248b
$func718 @ 00960502:0xb0036
$func829 @ 00960502:0xbf748
$func623 @ 00960502:0x9ec36
$func759 @ 00960502:0xb5990
$__wbindgen_export_8 @ 00960502:0x186a04
ke @ @finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:252
i @ @finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:202
Show 4 more frames
Show less
@finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:928 Uncaught (in promise) Error: Unknown error: remove_update
at n.wbg.__wbindgen_error_new (@finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:928:13)
at 00960502:0x102c4c
at 00960502:0x167a98
at 00960502:0x60369
at 00960502:0x109608
at 00960502:0x9ec36
at 00960502:0xb5990
at 00960502:0x186a04
at ke (@finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:252:5)
at i (@finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:202:14)
And then the following error:
Uncaught (in promise) Error: Unknown error: remove_update
at n.wbg.__wbindgen_error_new (@finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:928:13)
at 00960502:0x102c4c
at 00960502:0x167a98
at 00960502:0x60369
at 00960502:0x109608
at 00960502:0x9ec36
at 00960502:0xb5990
at 00960502:0x186a04
at ke (@finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:252:5)
at i (@finos_perspective-viewer_dist_esm_perspective-viewer__inline__js.js?v=f4f1a4ff:202:14)
Can these errors be ignored? Is there a better way to handle replacing a table purely on the server?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm updating from 2.10.0 to 3.1.3 and running into an lifecycle issue. There used to be
eject_table
andhost_table
methods which handled cleanup when replacing datasets purely on the server. Without those, I'm running into an issue where it seems I have to handle view/table cleanup on the client. (Note: this may have always been the case and I wasn't properly cleaning up views and it's now just more obvious in 3.0).Reading the docs about the Node.js backend detailed here it says that when you use
await websocket.open_table("table_one");
the "table
andview
objects live on the server."Here is the example from the docs:
I can keep track of a reference to the table object returned by
await table
but when I call.delete()
on this object, it says I have views that depend on it and it throws an error.On the client, I can call
elem.getView()
andelem.getTable()
and delete the returned objects and that works but I get the following warning:And then the following error:
Can these errors be ignored? Is there a better way to handle replacing a table purely on the server?
Beta Was this translation helpful? Give feedback.
All reactions