You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Query and grouped tables sort empty values first ascending; tag tables sort them last #1320
Tag 2 blocks with #Topic: "dated", with "when" set to any day, and "undated", without it.
On the Topic page, sort the table by "when" ascending.
Add a query block for (tags [[Topic]]), show it as a table, and sort it by "when" ascending.
Expected
Both tables list dated, then undated: a row with no value comes last in both directions, as on the tag page and as upstream's get-view-data-class-objects-missing-custom-sort-value-stays-last-test states.
Actual
The tag page lists dated, undated. The query table lists undated, dated. A tag page table grouped by any property also puts the rows with no value first within each group. The same holds for every property type, as soon as some rows lack the value.
Cause
get-view-data in deps/db/src/logseq/db/common/view.cljs sorts tag tables with sort-eids-by-sorting, whose compare-sort-values puts nil last in both directions. Query tables and grouped tables go through sort-entities, whose by-one-sorting calls compare, and compare puts nil first.
Found with a model-based property test of table views that compares the tag table with a query table over the same rows, replayed on upstream master 16c4ed1a0.
Activity
yuxi-liu-wired commentedon Oct 6, 2026
Fix: logseq/logseq#13610.