Azure / azure-event-hubs-node

Node client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
MIT License
50 stars 46 forks source link

custom user agent string could easily goes over the 128-character limit after the new guideline #192

Closed jeremymeng closed 5 years ago

jeremymeng commented 5 years ago

Describe the bug There's a hard limit of 128 characters on the user agent string: https://github.com/Azure/azure-event-hubs-node/blob/4a3961ee7165315b90dac974e94f305a1073b86b/client/lib/connectionContext.ts#L59-L62

with the new design/guideline on user agent string, a custom user agent string could easily go over the limit. For example, this test would fail when using the user agent string in new format, and with some preview version which makes the version string longer

2) EPH       user-agent
         should support appending custom user-agent:
     Error: The user-agent string cannot be more than 128 characters in length.The given user-agent string is: /js-event-hubs,azure-sdk-for-js/azure-event-processor-host/2.0.0-preview.1 (NODE-VERSION v11.9.0; Linux 4.15.0-1037-azure),my-custom-string with length: 139

Also this is only after updating the event-processor-host user agent string. Note that after the user agent string of the event hubs client is updated, /js-event-hubs in the above will also become a much longer string, which further increase the total length.

jeremymeng commented 5 years ago

Also note that the newer and longer base user agent is already a breaking change since existing customer code base might already use up all allowed characters.

jeremymeng commented 5 years ago

/cc @ramya-rao-a

jeremymeng commented 5 years ago

For reference, here are the two commits that update user agent strings to follow the new guidance

jeremymeng commented 5 years ago

Issue moved to Azure/azure-sdk-for-js #1211 via ZenHub