Repository navigation
fix(jdbc): preserve detected frameworks on client info updates - #3315
Conversation
chernser
left a comment
There was a problem hiding this comment.
Thank you for contribution!
Please address the comments and
add test to verify that user client string always in the format:
<app_name>/<app_version> <client_name>/<client_version> (<comment>; <key1>: <value1>; <key2>: <value2>)
Not parentheses in the middle (this is our format across all clients to make things clear)
Thanks!
|
Thanks for the review. Pushed 08f64da and e778908 on top of the earlier commits:
Your template shows a free Disclosure: this change was prepared with an AI coding assistant and reviewed before posting. |
AI review gate — the gate never ran on this headThe org-required gate workflow has no run on What to do: a maintainer runs History (latest 5 heads, newest first)
|
|
Hi @chernser, I've addressed the review feedback. Could you take another look when you have a moment? |
|
Thank you @pcbeingused333 ! I've approved. Will merge a bit later. |
AI review gate — Human approval in place of AI reviewApproved on the head commit by chernser (write access, not the author), standing in for the AI review:
What to do:
Evaluated at |
Fixes #3219
Summary
ConnectionImplandJdbcConfiguration.updateUserClientbuilt the JDBC client name separately, and the update path omitted the framework group. Use oneJdbcConfiguration.buildClientNamehelper for connection creation and updates. Keep the detected frameworks whenConnection.setClientInfo("ApplicationName", ...)updates or clears the application name. Respect disabled framework detection. Null and empty application names no longer add leading whitespace. An emptyclient_name(or legacyproduct_name) at connection creation also no longer adds a leading space.The existing framework group format is unchanged. This does not change public API signatures, property defaults, or JDBC value types. It restores the documented framework information after a client info update. Update the feature list and add a release note.
Tests
Add nine parameterized cases for nonempty, empty, and null application names with detected frameworks, no detected frameworks, and disabled detection. The tests use a real client and inspect its active configuration, rather than its initial configuration snapshot. Restore the framework detection cache after each case.
Run
ClientNameTestandJdbcConfigurationTestin Maven with Java 17. On main: 114 tests, 7 failures, 0 errors. With the fix: 114 tests, 0 failures, 0 errors.Checklist
history/latest/3219.md)AI assistance: OpenAI Codex generated the patch and regression tests.
Note
Low Risk
Low risk: observable HTTP User-Agent formatting and client-name whitespace fix only; no API or query/data-path changes.
Overview
JDBC
User-Agentbehavior now keeps auto-detected frameworks (e.g. Spark) whenConnection.setClientInfo("ApplicationName", ...)changes or clears the app name. Frameworks are emitted as anfwkey in theclient_id_metadatacomment group instead of a second parenthesized segment on the client name, and a user-providedclient_id_metadatafwoverrides detection.Client naming is unified through
JdbcConfiguration.buildClientName()for connect and client-info updates so the application prefix and driver suffix stay consistent. Null, empty, or unset application names no longer introduce leading whitespace in the header prefix.Docs and a changelog entry describe the new header shape; integration tests cover framework presence with varied app names, disabled detection, and custom
fwmetadata.Reviewed by Cursor Bugbot for commit 2201209. Bugbot is set up for automated code reviews on this repo. Configure here.