Repository navigation
Description
Steps
On a DB graph with a tag Project, a page holding 4 blocks tagged #Project ("Alpha task" to "Delta task"), and on the same page a query block {{query (tags [[Project]])}} made with /query and switched to Table View, on the web app:
- Click the text of the block "Alpha task #Project".
- Press Escape. The block is selected.
- Press Backspace. The block is deleted.
Expected
The table drops the row of "Alpha task".
Actual
The query block is replaced by the error box "Query error: Report issue" with the query text (tags [[Project]]). The console shows DB worker API failed: :thread-api/get-render-snapshots Error: Missing renderer resource entity.
The steps reproduced it 3 of 3 times (Playwright, trusted input, a new graph each time).
Cause (read in code)
The table is a view whose data the worker renders from a [:view-data view-uuid context] resource, and for a query the context carries :query-row-uuids, the rows of the [:query ...] resource (frontend.components.query.view/query-result). The worker's view-data renderer (src/main/frontend/worker/handler/render_resource/view.cljs) looks up each of those uuids with common/entity-by-uuid!, which throws "Missing renderer resource entity" for a uuid no entity carries.
After the delete, frontend.db.subs/apply-delta-store marks both resources stale, and schedule-resource-reload! reloads a :query resource after a 2000 ms timer but every other resource at once. The view data watches [:attr :block/updated-at] (the default sorting), which the delete touches, so it reloads right away with the row list from before the delete and the worker throws on the deleted row. The throw rejects the whole get-render-snapshots batch (frontend.db.subs-loader/flush! rejects every entry of it), so every view resource in that batch falls to an error state: in 1 run the page's Linked References section showed "Linked References: Unexpected error" beside the query, and in 15 runs the whole page showed the "Something went wrong" screen instead of the error box.
missing-view-data in the same file already renders a deleted view as empty for this reason (a delete racing an in-flight view-data request). A deleted row of a live view has no such path.
Found by a monkey test (gremlins.js with trusted Playwright input): 40 of 401 runs, all with the same worker frame (view-data, :query-row-uuid). ddmin reduced seed 2079 to 7 actions, the last 3 of which are a middle click on the table row of "Gamma task", Escape and Delete; the steps above are read from them.
The steps above fail 3 of 3 times on the web build of master 16c4ed1a0.
Activity
fix: skip deleted query table rows
fix(worker): skip deleted rows of a query table
fix: skip deleted query table rows (#13538)