Skip to content

fix(datasource): require POST to close connections - #2679

Merged
openai0229 merged 2 commits into
OtterMind:mainfrom
HandSonic:fix/connection-close-post-only
Sep 7, 2026
Merged

openai0229 merged 2 commits into
OtterMind:mainfrom
HandSonic:fix/connection-close-post-only

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Change /api/connection/close from GET query parameters to a validated POST JSON body because it removes an active connection.
  • Update the sole frontend caller contract for both Web and desktop IPC transports.
  • Add focused frontend and backend contract coverage.

Verification

  • DbDataSourceControllerTest: 1 test passed through the Maven reactor.
  • yarn test:connection-close-request passed.
  • Targeted ESLint and git diff --check passed.
  • Independent adversarial review: PASS, 0 blockers.
  • Fork CI: backend, frontend, Java/JavaScript CodeQL, repository/docs, licenses, and SBOM passed.

Fixes #2678

Latest-main verification (2026-09-04)

  • Rebased onto 144a04ee2; frontend request-contract test, targeted ESLint, and full web suite (80 tests) passed.n- Combined Community prebuild, Webpack production build, and bundle verification passed.n- Playwright right-clicked a live mocked data source and verified “关闭连接” sends POST /api/connection/close with zero unexpected console errors.

@HandSonic
HandSonic requested a review from openai0229 as a code owner August 11, 2026 13:26
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 11, 2026
@HandSonic
HandSonic force-pushed the fix/connection-close-post-only branch from e4d6b0e to 0beebc6 Compare August 11, 2026 13:36
openai0229

This comment was marked as outdated.

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GET-to-POST contract change itself matches #2678: the frontend sends POST /api/connection/close with { id }, and the controller delegates to removeConnection(id). There is no logic blocker in that focused change.

The branch is currently CONFLICTING with main, so it cannot merge as-is. Please rebase and preserve the newer controller/client changes, then rerun the focused frontend request-contract and controller tests. The separate legacy GET /datasource/close endpoint remains a pre-existing no-op and should be handled independently rather than folded into the conflict resolution.

@HandSonic
HandSonic force-pushed the fix/connection-close-post-only branch from 0beebc6 to 3265cec Compare September 3, 2026 22:55
@HandSonic
HandSonic requested review from a team and Aias00 as code owners September 3, 2026 22:55
@HandSonic

Copy link
Copy Markdown
Contributor Author

The requested rebase/integration is complete on the current head. Newer controller/client changes were preserved; the frontend contract and full web suite pass, and Playwright verified the actual context-menu action sends POST /api/connection/close. The separate legacy endpoint was not folded into this PR.

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed b97d38d after updating the branch from main. Its source tree is identical to the locally validated integration commit. No blocking findings.

The frontend sends POST JSON through the existing request helper, and the controller accepts the existing validated close-request DTO before delegating to the unchanged connection pool logic. Controller and connection pool tests passed (1 and 10 tests), as did frontend lint/prebuild/build and the 48-module backend package. Real HTTP and SQL Server session checks confirmed that GET and invalid bodies do not close sessions, a valid POST closes only the selected datasource, and repeated close/reconnect remains usable. Playwright covered mouse/keyboard close, menu dismissal, failure feedback, retained datasource configuration, and reconnect. JCEF transport was inspected statically, without a desktop runtime test.

This is a narrow HTTP contract correction; normal close/reconnect behavior remains the same. Fresh CI for this head must complete before merging.

@openai0229
openai0229 merged commit 5668ab0 into OtterMind:main Sep 7, 2026
17 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 7, 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.

bug(datasource): connection close mutates state through GET

2 participants