Skip to content

JSAPI sending updated events for modificaitons outside of the viewport #6053

@mofojed

Description

@mofojed

Description

When setting a viewport on a table and adding a listener, the listener is triggered whenever there is an update anywhere in the table, even if it doesn't affect the viewport. Related the JSAPI refactoring: #5890

Steps to reproduce

  1. Go to http://localhost:10000/jsapi/
  2. Enter the following snippet, which creates a ticking table and sets a viewport to the first row:
var dh = (await import('./dh-core.js')).default
var client = new dh.CoreClient(window.location.protocol + "//" + window.location.host);
await client.login({ type: dh.CoreClient.LOGIN_TYPE_ANONYMOUS });
var connection = await client.getAsIdeConnection();
var ide = await connection.startSession("python");
await ide.runCode(`
from deephaven import time_table
tt = time_table("PT1s").update(["X=i%2", "Y=i%5", "Z=i"])
`)

var tt = await connection.getObject({ type: 'Table', name: 'tt' })
var subscription = tt.setViewport(0, 0)
subscription.addEventListener('updated', event => {
    console.log('Received updated event', event.detail)
})

Expected results
2. Should receive one event and "Received update event" should be printed to the console once

Actual results
2. Update event is called for each tick on the table, even after the first row

Additional details and attachments

If applicable, add any additional screenshots, logs, or other attachments to help explain your problem.

Versions
Engine Version: 0.37.0-SNAPSHOT
Web UI Version: 0.92.0
Java Version: 11.0.24
Barrage Version: 0.6.0
Browser Name: Chrome 128
OS Name: Linux
deephaven-plugin-ptt-input: 0.0.1
@deephaven/js-plugin-plotly-express: 0.9.0
@deephaven/js-plugin-matplotlib: 0.4.1
@deephaven/js-plugin-ag-grid: 0.1.0
@deephaven/js-plugin-ui: 0.21.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreCore development tasksjsapi

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions