fix(datasource): require POST to close connections - #2679
Conversation
e4d6b0e to
0beebc6
Compare
openai0229
left a comment
There was a problem hiding this comment.
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.
0beebc6 to
3265cec
Compare
|
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
left a comment
There was a problem hiding this comment.
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.
Summary
/api/connection/closefrom GET query parameters to a validated POST JSON body because it removes an active connection.Verification
DbDataSourceControllerTest: 1 test passed through the Maven reactor.yarn test:connection-close-requestpassed.git diff --checkpassed.Fixes #2678
Latest-main verification (2026-09-04)
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 “关闭连接” sendsPOST /api/connection/closewith zero unexpected console errors.