{{ message }}
Repository navigation
fix: keep Empty when flipping is/is-not filters - #13751
Open
tiensonqin wants to merge 3 commits into
Open
tiensonqin wants to merge 3 commits into
tiensonqin wants to merge 3 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Switching a Tags Empty filter from
istois 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
:emptywhen 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
:is/:is-notkeep:emptythrough both directionsvalid-filters?/require-view-context!for the 3-tuple; persisted 2-element clauses are dropped before the view requestis↔is notwithout a crash, then clear the persisted filter so later All Pages tests can still see rowsTo show artifacts inline, enable in settings.