fix: keep Empty when flipping is/is-not filters by tiensonqin · Pull Request #13751 · logseq/logseq · GitHub
Skip to content

fix: keep Empty when flipping is/is-not filters - #13751

Open
tiensonqin wants to merge 3 commits into
masterfrom
logseq/fix-empty-filter-operator-c328
Open

tiensonqin wants to merge 3 commits into
masterfrom
logseq/fix-empty-filter-operator-c328

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Switching a Tags Empty filter from is to is not (or back) dropped the keyword value and persisted a 2-element clause:

{:or? false :filters [[:block/tags :is]]}

View resource validation requires every clause to be a 3-tuple, so All Pages crashed with Something went wrong / Invalid view resource context. The broken filter stayed on the view block, so the page kept crashing until the filter was removed.

This keeps :empty when flipping :is / :is-not, so the clause stays [:block/tags :is-not :empty]. Incomplete (not 3-tuple) clauses are dropped before the view resource request, so already-persisted broken filters no longer crash existing graphs.

Fixes logseq/db-test#1434

Demo

Tags is Empty, then the same filter after flipping to is not. No ErrorBoundary.

All Pages Tags is Empty filter

All Pages Tags is not Empty after operator flip

Tests

  • Worker: :is / :is-not keep :empty through both directions
  • UI clause + valid-filters? / require-view-context! for the 3-tuple; persisted 2-element clauses are dropped before the view request
  • clj-e2e: All Pages Filter → Tags → Is Empty → switch is ↔ is not without a crash, then clear the persisted filter so later All Pages tests can still see rows

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 3 commits October 13, 2026 16:52
Switching Tags is <-> is not on Empty dropped the keyword value and
persisted a 2-element clause that view resource validation rejects.
Keep :empty across the operator change, and drop incomplete clauses
before building the view resource context so already-broken filters
do not crash the page.

Fixes logseq/db-test#1434

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
The new Tags Empty operator test persisted the filter on the shared
All Pages view, so later tests in the namespace could not find rows.
Remove the filter in a finally block so the graph is left unfiltered.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toggling is/is not on a Tags "Empty" filter crashes All Pages with "Invalid view resource context"

2 participants