Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/servicebus/service-bus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

- Fix an issue where we don't respect user request to close the receiver if the connection is disconnected when using the `subscribe()` method. [PR #20427](https://github.com/Azure/azure-sdk-for-js/pull/20427)
- Correct typing of `propertiesToModify` options to `abandonMessages()`, `deferMessages()`, and "deadLetterMessages()" [PR #20577](https://github.com/Azure/azure-sdk-for-js/pull/20577)

### Other Changes

Expand Down
6 changes: 3 additions & 3 deletions sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,15 @@ export interface ServiceBusReceivedMessage extends ServiceBusMessage {
// @public
export interface ServiceBusReceiver {
abandonMessage(message: ServiceBusReceivedMessage, propertiesToModify?: {
[key: string]: any;
[key: string]: number | boolean | string | Date | null;
}): Promise<void>;
close(): Promise<void>;
completeMessage(message: ServiceBusReceivedMessage): Promise<void>;
deadLetterMessage(message: ServiceBusReceivedMessage, options?: DeadLetterOptions & {
[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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have tests for all these types?

}): Promise<void>;
entityPath: string;
getMessageIterator(options?: GetMessageIteratorOptions): AsyncIterableIterator<ServiceBusReceivedMessage>;
Expand Down
12 changes: 6 additions & 6 deletions sdk/servicebus/service-bus/src/receivers/receiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export interface ServiceBusReceiver {
*/
abandonMessage(
message: ServiceBusReceivedMessage,
propertiesToModify?: { [key: string]: any }
propertiesToModify?: { [key: string]: number | boolean | string | Date | null }
): Promise<void>;
/**
* Defers the processing of the message. Save the `sequenceNumber` of the message, in order to
Expand All @@ -219,7 +219,7 @@ export interface ServiceBusReceiver {
*/
deferMessage(
message: ServiceBusReceivedMessage,
propertiesToModify?: { [key: string]: any }
propertiesToModify?: { [key: string]: number | boolean | string | Date | null }
): Promise<void>;
/**
* Moves the message to the deadletter sub-queue. To receive a deadletted message, create a new
Expand All @@ -246,7 +246,7 @@ export interface ServiceBusReceiver {
*/
deadLetterMessage(
message: ServiceBusReceivedMessage,
options?: DeadLetterOptions & { [key: string]: any }
options?: DeadLetterOptions & { [key: string]: number | boolean | string | Date | null }
): Promise<void>;
/**
* Renews the lock on the message for the duration as specified during the Queue/Subscription
Expand Down Expand Up @@ -543,7 +543,7 @@ export class ServiceBusReceiverImpl implements ServiceBusReceiver {

async abandonMessage(
message: ServiceBusReceivedMessage,
propertiesToModify?: { [key: string]: any }
propertiesToModify?: { [key: string]: number | boolean | string | Date | null }
): Promise<void> {
this._throwIfReceiverOrConnectionClosed();
throwErrorIfInvalidOperationOnMessage(message, this.receiveMode, this._context.connectionId);
Expand All @@ -559,7 +559,7 @@ export class ServiceBusReceiverImpl implements ServiceBusReceiver {

async deferMessage(
message: ServiceBusReceivedMessage,
propertiesToModify?: { [key: string]: any }
propertiesToModify?: { [key: string]: number | boolean | string | Date | null }
): Promise<void> {
this._throwIfReceiverOrConnectionClosed();
throwErrorIfInvalidOperationOnMessage(message, this.receiveMode, this._context.connectionId);
Expand All @@ -575,7 +575,7 @@ export class ServiceBusReceiverImpl implements ServiceBusReceiver {

async deadLetterMessage(
message: ServiceBusReceivedMessage,
options?: DeadLetterOptions & { [key: string]: any }
options?: DeadLetterOptions & { [key: string]: number | boolean | string | Date | null }
): Promise<void> {
this._throwIfReceiverOrConnectionClosed();
throwErrorIfInvalidOperationOnMessage(message, this.receiveMode, this._context.connectionId);
Expand Down
8 changes: 5 additions & 3 deletions sdk/servicebus/service-bus/src/receivers/receiverCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function abandonMessage(
message: ServiceBusMessageImpl,
context: ConnectionContext,
entityPath: string,
propertiesToModify: { [key: string]: any } | undefined,
propertiesToModify: { [key: string]: number | boolean | string | Date | null } | undefined,
retryOptions: RetryOptions | undefined
): Promise<void> {
receiverLogger.verbose(
Expand All @@ -130,7 +130,7 @@ export function deferMessage(
message: ServiceBusMessageImpl,
context: ConnectionContext,
entityPath: string,
propertiesToModify: { [key: string]: any } | undefined,
propertiesToModify: { [key: string]: number | boolean | string | Date | null } | undefined,
retryOptions: RetryOptions | undefined
): Promise<void> {
receiverLogger.verbose(
Expand All @@ -152,7 +152,9 @@ export function deadLetterMessage(
message: ServiceBusMessageImpl,
context: ConnectionContext,
entityPath: string,
propertiesToModify: (DeadLetterOptions & { [key: string]: any }) | undefined,
propertiesToModify:
| (DeadLetterOptions & { [key: string]: number | boolean | string | Date | null })
| undefined,
retryOptions: RetryOptions | undefined
): Promise<void> {
receiverLogger.verbose(
Expand Down
6 changes: 3 additions & 3 deletions sdk/servicebus/service-bus/src/receivers/sessionReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export class ServiceBusSessionReceiverImpl implements ServiceBusSessionReceiver

async abandonMessage(
message: ServiceBusReceivedMessage,
propertiesToModify?: { [key: string]: any }
propertiesToModify?: { [key: string]: number | boolean | string | Date | null }
): Promise<void> {
this._throwIfReceiverOrConnectionClosed();
throwErrorIfInvalidOperationOnMessage(message, this.receiveMode, this._context.connectionId);
Expand All @@ -526,7 +526,7 @@ export class ServiceBusSessionReceiverImpl implements ServiceBusSessionReceiver

async deferMessage(
message: ServiceBusReceivedMessage,
propertiesToModify?: { [key: string]: any }
propertiesToModify?: { [key: string]: number | boolean | string | Date | null }
): Promise<void> {
this._throwIfReceiverOrConnectionClosed();
throwErrorIfInvalidOperationOnMessage(message, this.receiveMode, this._context.connectionId);
Expand All @@ -542,7 +542,7 @@ export class ServiceBusSessionReceiverImpl implements ServiceBusSessionReceiver

async deadLetterMessage(
message: ServiceBusReceivedMessage,
options?: DeadLetterOptions & { [key: string]: any }
options?: DeadLetterOptions & { [key: string]: number | boolean | string | Date | null }
): Promise<void> {
this._throwIfReceiverOrConnectionClosed();
throwErrorIfInvalidOperationOnMessage(message, this.receiveMode, this._context.connectionId);
Expand Down