Skip to content

fix(core-domain-api): volatile async state, escape quoted SQL values, fix XLXS typo, align PinTable hashCode - #2293

Merged
openai0229 merged 3 commits into
OtterMind:mainfrom
HandSonic:fix/review-core-domain-api
Jul 29, 2026
Merged

openai0229 merged 3 commits into
OtterMind:mainfrom
HandSonic:fix/review-core-domain-api

Conversation

@HandSonic

@HandSonic HandSonic commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Problem

Four defects in domain-api:

  1. ExportFileSuffixEnum typo: XLXS(".xlxs") — exported Excel files got the misspelled .xlxs suffix.
  2. Unescaped SQL literals: DataTypeEnum.getValue wrapped values in single quotes directly ("'" + value + "'") for BOOLEAN-fallback, DATETIME, CONTENT, STRUCT, DOCUMENT, ARRAY, OBJECT, REFERENCE, ROWID, ANY, and UNKNOWN — any value containing ', ", or \ produced broken or injectable SQL.
  3. AsyncContext visibility: finish, progress, info, and error are written by a worker thread and polled from another thread, but were not volatile — the poller could spin forever on a stale finish=false.
  4. PinTable equals/hashCode contract: PinTable overrides equals but not hashCode, so equal instances landed in different hash buckets and HashMap/HashSet/contains behaved incorrectly.

Fix

  • Rename enum constant to XLSX(".xlsx")
  • Route all those branches through getStringValue, which escapes \, ', and " before quoting
  • Mark the four AsyncContext fields volatile
  • Add PinTable.hashCode over the same fields used by equals

Tests

New ExportFileSuffixEnumTest, DataTypeEnumTest, AsyncContextTest, PinTableTest (junit-jupiter added to module test scope). mvn test on chat2db-community-domain-api: 11/11 pass.


Verified on fork HandSonic#22 (meaningful CI checks green; dependency-review/project-sync jobs are fork-permission noise). Regression tests pass; adversarial review cleared.

… fix XLXS typo, align PinTable hashCode (code review follow-up)
@openai0229
openai0229 merged commit c188500 into OtterMind:main Jul 29, 2026
16 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 29, 2026
@HandSonic
HandSonic deleted the fix/review-core-domain-api branch August 23, 2026 08:13
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