[ServiceBus] correct types for propertiesToModify options#20577
[ServiceBus] correct types for propertiesToModify options#20577jeremymeng merged 3 commits intoAzure:mainfrom
propertiesToModify options#20577Conversation
We claim that we can take `any` type of property values for properties to be modified but it's `applicationProperties` part of a Service Bus message that is modified. That property has a type of `number | boolean | string | Date | null` and is what the service supports. This PR corrects the types for these options to align with `applicationProperties`. Even though it shows as a breaking change, other unsupported types (e.g., an object literal) would cause service errors so they never worked.
|
API changes have been detected in API changes - [key: string]: any;
+ [key: string]: number | boolean | string | Date | null;
- [key: string]: any;
+ [key: string]: number | boolean | string | Date | null;
- [key: string]: any;
+ [key: string]: number | boolean | string | Date | null; |
| }): Promise<void>; | ||
| deferMessage(message: ServiceBusReceivedMessage, propertiesToModify?: { | ||
| [key: string]: any; | ||
| [key: string]: number | boolean | string | Date | null; |
There was a problem hiding this comment.
do we have tests for all these types?
We have coverage on these types in |
deyaaeldeen
left a comment
There was a problem hiding this comment.
I understand the change is to shift some errors to compile time instead of runtime ones coming from core/service, but I wonder if there is any code out there that could break because of this.
Yeah, I think it's a valid concern. I could probably add clarification on supported types in the ref doc, and leave this PR for next major release. |
|
After discussing with JS architects, this is promoting a runtime error to a compiler error and is considered a bug fix. |
|
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
|
API changes have been detected in API changes - [key: string]: any;
+ [key: string]: number | boolean | string | Date | null;
- [key: string]: any;
+ [key: string]: number | boolean | string | Date | null;
- [key: string]: any;
+ [key: string]: number | boolean | string | Date | null; |
) We claim that we can take `any` type of property values for properties to be modified but it's `applicationProperties` part of a Service Bus message that is modified. That property has a type of `number | boolean | string | Date | null` and is what the service supports. This PR corrects the types for these options to align with `applicationProperties`. Even though it shows as a breaking change, other unsupported types (e.g., an object literal) would cause service errors so they never worked.
We claim that we can take
anytype of property values for properties to bemodified but it's
applicationPropertiespart of a Service Bus message that ismodified. That property has a type of
number | boolean | string | Date | nulland is what the service supports.
This PR corrects the types for these options to align with
applicationProperties. Even though it shows as a breaking change, otherunsupported types (e.g., an object literal) would cause service errors so they
never worked.
Packages impacted by this PR
@azure/service-bus
Issues associated with this PR
#20545
Are there test cases added in this PR? (If not, why?)
Not needed. Just type checking.