-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repro(zql): not exists bug #3534
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Branch | mlaw/repro-not-exists |
Testbed | localhost |
Click to view all benchmark results
Benchmark | File Size | Benchmark Result kilobytes (KB) (Result Δ%) | Upper Boundary kilobytes (KB) (Limit %) |
---|---|---|---|
zero-package.tgz | 📈 view plot 🚷 view threshold | 961.11 (-0.58%) | 1,015.09 (94.68%) |
zero.js | 📈 view plot 🚷 view threshold | 181.15 (-2.36%) | 194.81 (92.99%) |
zero.js.br | 📈 view plot 🚷 view threshold | 50.83 (-1.81%) | 54.35 (93.52%) |
@tantaman Wow. Great job reproducing! Any theories on where the bug is? |
A related issue has to do with trying to get the client to keep rows so it can compute This is broken for
A comment is added to issue 1, becoming the first comment for that issue. Issue 1 is then removed from the query results due to |
d9dca32
to
9d7ef92
Compare
This does present a problem although maybe not the exact problem the user described. If we are not sending down the rows to compute |
9d7ef92
to
85f6872
Compare
via pipeline driver testing
85f6872
to
10eacae
Compare
We'll be disabling Some ideas for fixes:
Example of (1): // client query:
z.issue.whereExists('assignee')
// server query
z.issue.whereExists('assignee').related('assignee', q => q.limit(2));
// ^- use related to sync what rows you'd like to use for the client to satisfy exists clauses
// todo: work out how this looks for `not exists` Example of (2):
If we have To compute this for every row on device using the CVR synthetic source: cvr.issue.related('assignee') TODO: how does this work with many nested |
This reproduces a user report with queries that use
NOT EXISTS
.Thread: https://discord.com/channels/830183651022471199/1326515508534579240/1326515834763612241
Summary of what they saw --
trackable
row{id: '001', name: 'trackable 1'}
.After adding a
trackableGroup
row withgroup
set toarchived
, thetrackable
row returnedby the query is removed. As expected.
When deleting the
trackableGroup
row, thetrackable
row is not returned by the query. This is unexpected. The row should be returned since it is no longer archived.This repro shows that
zql
(not-exists.test.ts) does the correct thing but thepipeline-driver
(pipeline-driver.repro.test.ts) is sending the wrong number ofadd
andremove
changes.After the
trackableGroup
row is deleted from the server, the client is still left with 1trackableGroup
row on their device.