Skip to content

Stale row responses can render over a newer one #79

Description

@gordonmurray

loadData() in web/vanilla/app.js has no check for stale responses. Every response renders, even when a newer request started after it.

There are two ways to see this:

  1. Select a dataset. While the first page loads, select a subset of columns and press Apply. If the first request finishes last, the table shows all columns again. The column selector still shows the subset, so the table and the controls disagree.
  2. Select a dataset, then select a second dataset before the first one loads. The rows of the first dataset can render under the title of the second.

loadData() reads this.currentDataset when it builds the request. It then renders whatever comes back. There is no request identifier and no cancellation.

One fix is a request counter on the class. loadData() takes the next number before the fetch, then compares the number after the fetch, and returns early when the number changed. AbortController is the other option.

This behaviour predates #73. Codex found it during the review of that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions