Skip to content

Commit

Permalink
Fixing an issue where our property ordering makes it so our edits app…
Browse files Browse the repository at this point in the history
…ear to take effect but don't actually alter the entity.

Fixes Azure#14539
  • Loading branch information
Richard Park committed Apr 2, 2021
1 parent b37db39 commit ec2efa5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ import {
*/
export function buildQueueOptions(queue: CreateQueueOptions): InternalQueueOptions {
return {
// NOTE: this ordering is extremely important. As an example, misordering of the ForwardTo property
// resulted in a customer bug where the Forwarding attributes appeared to be set but the portal was
// not picking up on it.
//
// The authority on this ordering is here:
// https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueuePropertiesExtensions.cs#L20

LockDuration: queue.lockDuration,
MaxSizeInMegabytes: getStringOrUndefined(queue.maxSizeInMegabytes),
RequiresDuplicateDetection: getStringOrUndefined(queue.requiresDuplicateDetection),
Expand All @@ -40,15 +47,25 @@ export function buildQueueOptions(queue: CreateQueueOptions): InternalQueueOptio
DuplicateDetectionHistoryTimeWindow: queue.duplicateDetectionHistoryTimeWindow,
MaxDeliveryCount: getStringOrUndefined(queue.maxDeliveryCount),
EnableBatchedOperations: getStringOrUndefined(queue.enableBatchedOperations),
AuthorizationRules: getRawAuthorizationRules(queue.authorizationRules),

// TODO: found while syncing the ordering. This property is in .net, but not in ours?
//IsAnonymousAccessible: false,

AuthorizationRules: getRawAuthorizationRules(queue.authorizationRules),
Status: getStringOrUndefined(queue.status),
ForwardTo: getStringOrUndefined(queue.forwardTo),
UserMetadata: getStringOrUndefined(queue.userMetadata),

// TODO: found while syncing the ordering. This property is in .net, but not in ours?
// SupportOrdering: true,

AutoDeleteOnIdle: getStringOrUndefined(queue.autoDeleteOnIdle),
EnablePartitioning: getStringOrUndefined(queue.enablePartitioning),
ForwardDeadLetteredMessagesTo: getStringOrUndefined(queue.forwardDeadLetteredMessagesTo),
ForwardTo: getStringOrUndefined(queue.forwardTo),
UserMetadata: getStringOrUndefined(queue.userMetadata),

// TODO: can't find this in the .net ATOM library.
EntityAvailabilityStatus: getStringOrUndefined(queue.availabilityStatus),
EnableExpress: getStringOrUndefined(queue.enableExpress)
EnableExpress: getStringOrUndefined(queue.enableExpress),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export function buildSubscriptionOptions(
subscription: CreateSubscriptionOptions
): InternalSubscriptionOptions {
return {
// NOTE: this ordering is extremely important. As an example, misordering of the ForwardTo property
// resulted in a customer bug where the Forwarding attributes appeared to be set but the portal was
// not picking up on it.
//
// The authority on this ordering is here:
// https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionPropertiesExtensions.cs#L191
LockDuration: subscription.lockDuration,
RequiresSession: getStringOrUndefined(subscription.requiresSession),
DefaultMessageTimeToLive: getStringOrUndefined(subscription.defaultMessageTimeToLive),
Expand All @@ -55,6 +61,7 @@ export function buildSubscriptionOptions(
UserMetadata: getStringOrUndefined(subscription.userMetadata),
ForwardDeadLetteredMessagesTo: getStringOrUndefined(subscription.forwardDeadLetteredMessagesTo),
AutoDeleteOnIdle: getStringOrUndefined(subscription.autoDeleteOnIdle),
// TODO: EntityAvailabilityStatus does not exist in .net
EntityAvailabilityStatus: getStringOrUndefined(subscription.availabilityStatus)
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,28 @@ import {
*/
export function buildTopicOptions(topic: CreateTopicOptions): InternalTopicOptions {
return {
// NOTE: this ordering is extremely important. As an example, misordering of the ForwardTo property
// resulted in a customer bug where the Forwarding attributes appeared to be set but the portal was
// not picking up on it.
//
// The authority on this ordering is here:
// https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicPropertiesExtensions.cs#L175

DefaultMessageTimeToLive: topic.defaultMessageTimeToLive,
MaxSizeInMegabytes: getStringOrUndefined(topic.maxSizeInMegabytes),
RequiresDuplicateDetection: getStringOrUndefined(topic.requiresDuplicateDetection),
DuplicateDetectionHistoryTimeWindow: topic.duplicateDetectionHistoryTimeWindow,
EnableBatchedOperations: getStringOrUndefined(topic.enableBatchedOperations),
// TODO: in .net, but not in here: FilteringMessagesBeforePublishing
// TODO: in .net, but not in here: IsAnonymousAccessible
AuthorizationRules: getRawAuthorizationRules(topic.authorizationRules),
Status: getStringOrUndefined(topic.status),
// TODO: in .net, but not in here: ForwardTo
UserMetadata: getStringOrUndefined(topic.userMetadata),
SupportOrdering: getStringOrUndefined(topic.supportOrdering),
AutoDeleteOnIdle: getStringOrUndefined(topic.autoDeleteOnIdle),
EnablePartitioning: getStringOrUndefined(topic.enablePartitioning),
// TODO: in .net, but not in here: EnableSubscriptionPartitioning
EntityAvailabilityStatus: getStringOrUndefined(topic.availabilityStatus),
EnableExpress: getStringOrUndefined(topic.enableExpress)
};
Expand Down

0 comments on commit ec2efa5

Please sign in to comment.