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
Create table: Table in node.js with a schema and index via const table = perspective.table(schema, { index }).
Call await table.update(rows) where n = rows.length.
Next call const m = await table.size() and compare n to m.
Expected Result:
I expected the result of await table.size() to reflect the change from the previous call to await table.update().
Actual Result:
It seems to sometimes return the size from before the execution of the update (i.e. m = 0). Here is some example logging:
INFO [1] Perspective updated data in table XXX with 251 new rows, leaving a total of 0 rows
where n = 251 and m = 0. The rows exist in the table and are visible in the UI.
Environment:
Using Node.js 12.x, Perspective 0.4.5, Typescript 3.8.3, running on linux (typically inside docker).
Additional Context:
I am trying to keep an up-to-date count of the number of rows in each of the tables. We have many tables and users may select one in the UI, upon which the client will connect to the table via websocket. However it would be convenient to know the size of the tables (particularly e.g. if they are empty) before selecting it, without having to create a connection to each and every table. Thus we are attempting to have the node.js backend track this seperately after each data update.
The text was updated successfully, but these errors were encountered:
This issue was fixed in PR #961, and should be in the latest 0.4.6 release of Perspective. I have added a test for this issue on a separate branch to prevent regression as well.
Bug Report
Steps to Reproduce:
table: Table
in node.js with a schema and index viaconst table = perspective.table(schema, { index })
.await table.update(rows)
wheren = rows.length
.const m = await table.size()
and comparen
tom
.Expected Result:
I expected the result of
await table.size()
to reflect the change from the previous call toawait table.update()
.Actual Result:
It seems to sometimes return the size from before the execution of the update (i.e.
m = 0
). Here is some example logging:where
n = 251
andm = 0
. The rows exist in the table and are visible in the UI.Environment:
Using Node.js 12.x, Perspective 0.4.5, Typescript 3.8.3, running on linux (typically inside docker).
Additional Context:
I am trying to keep an up-to-date count of the number of rows in each of the tables. We have many tables and users may select one in the UI, upon which the client will connect to the table via websocket. However it would be convenient to know the size of the tables (particularly e.g. if they are empty) before selecting it, without having to create a connection to each and every table. Thus we are attempting to have the node.js backend track this seperately after each data update.
The text was updated successfully, but these errors were encountered: