Skip to content

Commit db2fb63

Browse files
dnplkndllclaude
andauthored
fix(view): "Not Specified" group shows assigned issues (#10606) (#10666)
When grouping by assignee with a secondary grouping (e.g. by Status), the "Not Specified" category passed `undefined` as the query value. Since `undefined` is stripped during JSON serialization, the server received no filter and returned all documents — causing assigned issues to appear under "Not Specified". Use `null` instead so the filter survives serialization and correctly matches only documents where the field is unset. Fixes #10606 Signed-off-by: Don Kendall <kendall@donkendall.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c800a95 commit db2fb63

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
//
2+
// Copyright © 2026 Hardcore Engineering Inc.
3+
//
4+
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License. You may
6+
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
//
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
import { findProperty } from '../query'
17+
import type { Doc, Ref, Class } from '../classes'
18+
19+
function doc (id: string, fields: Record<string, any> = {}): Doc {
20+
return { _id: id as Ref<Doc>, _class: 'test:class:Issue' as Ref<Class<Doc>>, ...fields } as Doc
21+
}
22+
23+
describe('findProperty', () => {
24+
const assigned1 = doc('i1', { assignee: 'person:1' })
25+
const assigned2 = doc('i2', { assignee: 'person:2' })
26+
const unassigned = doc('i3', { assignee: null })
27+
const missingField = doc('i4')
28+
const allDocs = [assigned1, assigned2, unassigned, missingField]
29+
30+
it('should match a specific value', () => {
31+
const result = findProperty(allDocs, 'assignee', 'person:1')
32+
expect(result).toEqual([assigned1])
33+
})
34+
35+
it('should match null to docs with null or missing field', () => {
36+
const result = findProperty(allDocs, 'assignee', null)
37+
expect(result).toEqual([unassigned, missingField])
38+
})
39+
40+
it('should match undefined to docs with null or missing field', () => {
41+
const result = findProperty(allDocs, 'assignee', undefined)
42+
expect(result).toEqual([unassigned, missingField])
43+
})
44+
45+
describe('JSON round-trip (simulates server query)', () => {
46+
it('null survives JSON serialization and filters correctly', () => {
47+
const query = { assignee: null }
48+
const roundTripped = JSON.parse(JSON.stringify(query))
49+
expect(roundTripped).toHaveProperty('assignee')
50+
51+
const result = findProperty(allDocs, 'assignee', roundTripped.assignee)
52+
expect(result).toEqual([unassigned, missingField])
53+
})
54+
55+
it('undefined is stripped by JSON serialization, losing the filter', () => {
56+
const query = { assignee: undefined }
57+
const roundTripped = JSON.parse(JSON.stringify(query))
58+
expect(roundTripped).not.toHaveProperty('assignee')
59+
60+
// Without the 'assignee' key, matchQuery iterates only the remaining keys
61+
// and never calls findProperty for assignee, so all docs pass through.
62+
// This is the root cause of #10606.
63+
})
64+
})
65+
})

plugins/view-resources/src/components/list/ListCategories.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
: resultQuery[groupByKey]?.$in?.length !== 0
379379
? undefined
380380
: []
381-
: category
381+
: category ?? null
382382
}
383383
}
384384
</script>

0 commit comments

Comments
 (0)