Skip to content

fix(storage): honor local datasource filters - #2820

Merged
openai0229 merged 2 commits into
OtterMind:mainfrom
HandSonic:fix/local-datasource-filters
Sep 15, 2026
Merged

openai0229 merged 2 commits into
OtterMind:mainfrom
HandSonic:fix/local-datasource-filters

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Related issue

N/A - this defect was found during review of local datasource pagination; no public issue currently tracks it.

Summary

  • Apply alias search and datasource-kind filters before pagination and total calculation.
  • Match the actual PRIVATE and SHARED kind codes case-insensitively.
  • Treat legacy null kinds as private and handle null aliases without failing.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Reproduced on current main: the original 3 filter tests ran with 2 failures (name and kind filters ignored).
  • After integration with main, storage reactor package passed: storage 65, tools 77, domain-api 27; 169 tests, zero failures/errors/skips.
  • Command: mvn -B -ntp -f chat2db-community-server/pom.xml -pl :chat2db-community-storage -am -Dmaven.test.skip=false -DskipTests=false '-Dsurefire.includes=**/*Test.java' -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false package. Test JVM home/temp directories were isolated.
  • Executable backend package passed. Fresh Playwright CLI verification created four SQLite connections through the UI and checked real browser requests for case-insensitive search, both result pages, out-of-range pages, totals, empty results, blank filters and reload.
  • The two PR files in the integrated head are byte-identical to the Web-tested version. New-head checks are available below.
  • Scope: the Web list request exposes searchKey but does not expose kind; kind filtering is verified at the storage layer. This does not change sidebar tree search.

Risk and compatibility

  • Public API or stored data: No request/response or on-disk schema changes. Existing query fields now affect local storage results as their contract requires.
  • Database or driver compatibility: N/A - filtering is limited to the local datasource store.
  • Network, privacy, or security: N/A - no network, credential, or password handling changes.
  • Community / Local / Pro boundary: The change is confined to LocalWorkspaceStorage; other storage implementations and editions are unchanged.
  • Backward compatibility: Unfiltered listing order and pagination are unchanged. Legacy records with a null kind are intentionally included by the private filter.

Reviewer map

  • Reviewer: @openai0229 (default CODEOWNER for community storage).
  • Start here: LocalWorkspaceStorage.listDataSources, then the three filter-focused cases in LocalWorkspaceStorageDataSourceFilterTest.
  • Failure condition: Search and kind filters must be applied before slicing and total calculation; null aliases must not throw, and legacy null kinds must match PRIVATE.
  • Rollback or disable path: Revert commit 7191e49bd0a96a88d1e786558bc6a54714e77147; there is no runtime flag because this makes existing request fields effective for local storage.

Contributor declaration

  • I linked the Issue that defines this change. (N/A - no public issue exists.)
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: Substantial AI assistance was used for implementation, tests, and adversarial review; the resulting diff and test evidence were manually inspected.

@HandSonic
HandSonic force-pushed the fix/local-datasource-filters branch from 264c19b to 7191e49 Compare September 3, 2026 18:47
@openai0229
openai0229 merged commit 6d97140 into OtterMind:main Sep 15, 2026
19 of 21 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants