Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core-amqp] Fixing typos #8956

Merged
merged 2 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions sdk/core/core-amqp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## 1.1.2 (2020-04-28)

- Adds compatiblity with TypeScript versions 3.1 through 3.6+.
- Adds compatibility with TypeScript versions 3.1 through 3.6+.
[PR 8540](https://github.com/Azure/azure-sdk-for-js/pull/8540)
- Add a new method `refreshConnection()` on the `ConnectionContextBase` to replace the `connection` property on it with a new rhea-promise `Connection` object.
[PR 8563](https://github.com/Azure/azure-sdk-for-js/pull/8563)
Expand Down Expand Up @@ -46,7 +46,7 @@

## 1.0.0-preview.4 (2019-10-07)

- Fixes bug where calling `sendRequest` from a `RequestResponseLink` mulitple
- Fixes bug where calling `sendRequest` from a `RequestResponseLink` multiple
times in parallel would result in all but 1 calls being retried.

## 1.0.0-preview.3 (2019-09-09)
Expand All @@ -60,7 +60,7 @@ Updates types for better compatibility with TypeScript 3.6.x. (PR #4928)
- Support for exponential retry has been added
- Support for cancellation has been added via an optional `AbortSignal` from the [@azure/abort-controller](https://www.npmjs.com/package/@azure/abort-controller) package.
- The `RequestResponseLink` class has been updated to not have retries anymore for the `sendRequest()` method. The caller of this method is expected to add the relevant retries.
- All time related entites have been updated to use milli seconds as the unit of time for consistency.
- All time related entities have been updated to use milliseconds as the unit of time for consistency.
- New error `InsufficientCreditError` is introduced for the scenario where [rhea](https://www.npmjs.com/package/rhea) is unable to send events due to its internal buffer being full. This is a transient error and so is treated as retryable.
- The error `OperationTimeoutError` was previously mistakenly classified as an AMQP error which is now corrected. Since this can also be a transient error, it is treated as retryable.

Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ You can set the `AZURE_LOG_LEVEL` environment variable to one of the following v
- warning
- error

You can also set the log level programatically by importing the
You can also set the log level programmatically by importing the
[@azure/logger](https://www.npmjs.com/package/@azure/logger) package and calling the
`setLogLevel` function with one of the log level values.
For example, when you set the log level to `info`, the logs that are written for levels
`warning` and `error` are also emitted.
This SDK follows the Azure SDK for TypeScript [guidelines](https://azure.github.io/azure-sdk/typescript_implementation.html#general-logging)
when determining which level to log to.

When setting a log level either programatically or via the `AZURE_LOG_LEVEL` environment variable,
When setting a log level either programmatically or via the `AZURE_LOG_LEVEL` environment variable,
any logs that are written using a log level equal to or less than the one you choose will be emitted.

You can alternatively set the `DEBUG` environment variable to get logs when using this library.
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/core-amqp/src/ConnectionContextBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export interface ConnectionContextBase {
*/
readonly config: ConnectionConfig;
/**
* @property {string} connectionLock The unqiue lock name per connection that is used to
* acquire the lock for establishing an aqmp connection per client if one does not exist.
* @property {string} connectionLock The unique lock name per connection that is used to
* acquire the lock for establishing an amqp connection per client if one does not exist.
*/
connectionLock: string;
/**
* @property {string} negotiateClaimLock The unqiue lock name per connection that is used to
* @property {string} negotiateClaimLock The unique lock name per connection that is used to
* acquire the lock for negotiating cbs claim by an entity on that connection.
*/
negotiateClaimLock: string;
Expand Down
14 changes: 7 additions & 7 deletions sdk/core/core-amqp/src/cbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ export interface CbsResponse {

/**
* @class CbsClient
* Describes the EventHub/ServiceBus Cbs client that talks to the $cbs endopint over AMQP connection.
* Describes the EventHub/ServiceBus Cbs client that talks to the $cbs endpoint over AMQP connection.
*/
export class CbsClient {
/**
* @property {string} endpoint CBS endpoint - "$cbs"
*/
readonly endpoint: string = Constants.cbsEndpoint;
/**
* @property {string} replyTo CBS replyTo - The reciever link name that the service should reply to.
* @property {string} replyTo CBS replyTo - The receiver link name that the service should reply to.
*/
readonly replyTo: string = `${Constants.cbsReplyTo}-${generate_uuid()}`;
/**
* @property {string} cbsLock The unqiue lock name per $cbs session per connection that is used to
* acquire the lock for establishing a cbs session if one does not exist for an aqmp connection.
* @property {string} cbsLock The unique lock name per $cbs session per connection that is used to
* acquire the lock for establishing a cbs session if one does not exist for an amqp connection.
*/
readonly cbsLock: string = `${Constants.negotiateCbsKey}-${generate_uuid()}`;
/**
* @property {string} connectionLock The unqiue lock name per connection that is used to
* @property {string} connectionLock The unique lock name per connection that is used to
* acquire the lock for establishing an amqp connection if one does not exist.
*/
readonly connectionLock: string;
Expand All @@ -63,7 +63,7 @@ export class CbsClient {

/**
* @constructor
* @param {Connection} connection The AMQP conection.
* @param {Connection} connection The AMQP connection.
* @param {string} connectionLock A unique string (usually a guid) per connection.
*/
constructor(connection: Connection, connectionLock: string) {
Expand Down Expand Up @@ -144,7 +144,7 @@ export class CbsClient {
} catch (err) {
err = translate(err);
logger.warning(
"[%s] An error occured while establishing the cbs links: %O",
Copy link
Member

Choose a reason for hiding this comment

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

So here's a funny situation. If a customer sends us logs and we go and search for the message in our code we won't be able to find it anymore.

Might not be a big deal as long as we're aware that misspellings have been corrected :)

CC: @ramya-rao-a , @chradek , @HarshaNalluru

Copy link
Contributor

Choose a reason for hiding this comment

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

If this was for @azure/amqp-common, then I would have the same concerns. This is because the number of existing customers using Track 1 EH & SB in production would be much larger than the ones for Track 2 at this point in time. Right now, this concerns customers who have EH Track 2 in production, and am ok to bite the bullet and get it done.

"[%s] An error occurred while establishing the cbs links: %O",
this.connection.id,
err
);
Expand Down
16 changes: 8 additions & 8 deletions sdk/core/core-amqp/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export enum ConditionErrorNameMapper {
*/
"com.microsoft:no-matching-subscription" = "NoMatchingSubscriptionError",
/**
* Error is thrown when an attempt is made to access a parition that is not owned by the
* Error is thrown when an attempt is made to access a partition that is not owned by the
* requesting entity.
*/
"com.microsoft:partition-not-owned" = "PartitionNotOwnedError",
Expand Down Expand Up @@ -78,7 +78,7 @@ export enum ConditionErrorNameMapper {
*/
"com.microsoft:session-cannot-be-locked" = "SessionCannotBeLockedError",
/**
* Error is thrown when an internal server error occured. You may have found a bug?
* Error is thrown when an internal server error occurred. You may have found a bug?
*/
"amqp:internal-error" = "InternalServerError", // Retryable
/**
Expand Down Expand Up @@ -255,7 +255,7 @@ export enum ErrorNameConditionMapper {
*/
NoMatchingSubscriptionError = "com.microsoft:no-matching-subscription",
/**
* Error is thrown when an attempt is made to access a parition that is not owned by the
* Error is thrown when an attempt is made to access a partition that is not owned by the
* requesting entity.
*/
PartitionNotOwnedError = "com.microsoft:partition-not-owned",
Expand Down Expand Up @@ -284,7 +284,7 @@ export enum ErrorNameConditionMapper {
*/
SessionCannotBeLockedError = "com.microsoft:session-cannot-be-locked",
/**
* Error is thrown when an internal server error occured. You may have found a bug?
* Error is thrown when an internal server error occurred. You may have found a bug?
*/
InternalServerError = "amqp:internal-error", // Retryable
/**
Expand Down Expand Up @@ -554,7 +554,7 @@ export const retryableErrors: string[] = [
];

/**
* Maps some SytemErrors to amqp error conditions
* Maps some SystemErrors to amqp error conditions
* @enum SystemErrorConditionMapper
*/
export enum SystemErrorConditionMapper {
Expand Down Expand Up @@ -592,7 +592,7 @@ export function isSystemError(err: any): err is NetworkSystemError {

/**
* @internal
* Since browser doesnt differentiate between the various kinds of service communication errors,
* Since browser doesn't differentiate between the various kinds of service communication errors,
* this utility is used to look at the error target to identify such category of errors.
* For more information refer to - https://html.spec.whatwg.org/multipage/comms.html#feedback-from-the-protocol
* @param err object that may contain error information
Expand Down Expand Up @@ -622,7 +622,7 @@ const rheaPromiseErrors = [
];

/**
* Translates the AQMP error received at the protocol layer or a SystemError into a MessagingError.
* Translates the AMQP error received at the protocol layer or a SystemError into a MessagingError.
* All other errors are returned unaltered.
*
* @param {AmqpError} err The amqp error that was received.
Expand Down Expand Up @@ -684,7 +684,7 @@ export function translate(err: AmqpError | Error): MessagingError | Error {
}

if (isBrowserWebsocketError(err)) {
// Translate browser communication errors during opening handshake to generic SeviceCommunicationError
richardpark-msft marked this conversation as resolved.
Show resolved Hide resolved
// Translate browser communication errors during opening handshake to generic ServiceCommunicationError
const error = new MessagingError("Websocket connection failed.");
error.code = ConditionErrorNameMapper[ErrorNameConditionMapper.ServiceCommunicationError];
error.retryable = false;
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/src/messageHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { logger } from "./log";
export interface MessageHeader {
/**
* @property {boolean} [firstAcquirer] If this value is true, then this message has not been
* acquired by any other link. Ifthis value is false, then this message MAY have previously
* acquired by any other link. If this value is false, then this message MAY have previously
* been acquired by another link or links.
*/
firstAcquirer?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/src/messageProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { logger } from "./log";
*/
export interface MessageProperties {
/**
* @property {string | number | Buffer} [messageId] The application message identifier that uniquely idenitifes a message.
* @property {string | number | Buffer} [messageId] The application message identifier that uniquely identifies a message.
* The user is responsible for making sure that this is unique in the given context. Guids usually make a good fit.
*/
messageId?: string | number | Buffer;
Expand All @@ -31,7 +31,7 @@ export interface MessageProperties {
contentType?: string;
/**
* @property {string} [contentEncoding] The content-encoding property is used as a modifier to the content-type.
* When present, its valueindicates what additional content encodings have been applied to the application-data.
* When present, its value indicates what additional content encodings have been applied to the application-data.
*/
contentEncoding?: string;
/**
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/src/requestResponseLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class RequestResponseLink implements ReqResLink {
request.correlation_id !== responseCorrelationId
) {
// do not remove message listener.
// parallel requests listen on the same receiver, so continue waiting until respose that matches
// parallel requests listen on the same receiver, so continue waiting until response that matches
// request via correlationId is found.
logger.verbose(
"[%s] request-messageId | '%s' != '%s' | response-correlationId. " +
Expand Down Expand Up @@ -219,7 +219,7 @@ export class RequestResponseLink implements ReqResLink {
logger.verbose(
"[%s] %s request sent: %O",
this.connection.id,
request.to || "$managment",
request.to || "$management",
request
);
this.sender.send(request);
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/src/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export async function retry<T>(config: RetryConfig<T>): Promise<T> {
}
lastError = err;
logger.verbose(
"[%s] Error occured for '%s' in attempt number %d: %O",
"[%s] Error occurred for '%s' in attempt number %d: %O",
config.connectionId,
config.operationType,
i,
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface EventHubConnectionStringModel {
}

/**
* Describes the stroage connection string model.
* Describes the storage connection string model.
*/
export interface StorageConnectionStringModel {
DefaultEndpointsProtocol: string;
Expand Down Expand Up @@ -169,7 +169,7 @@ export const defaultLock: AsyncLock = new AsyncLock({ maxPending: 10000 });
/**
* Describes a Timeout class that can wait for the specified amount of time and then resolve/reject
* the promise with the given value.
* @class Timout
* @class Timeout
*/
export class Timeout {
// Node and browsers return different types from setTimeout
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/test/message.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe("message", function() {
});
});

describe("poperties", function() {
describe("properties", function() {
it("should be able to convert empty MessageProperties to AmqpMessageProperties", function(done) {
const msgProperties: MessageProperties = {};
const amqpMsgProperties: AmqpMessageProperties = MessageProperties.toAmqpMessageProperties(
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/test/requestResponse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe("RequestResponseLink", function() {
assert.equal(response.correlation_id, req.message_id);
});

it("should send parellel requests and receive responses correctly", async function() {
it("should send parallel requests and receive responses correctly", async function() {
const connectionStub = stub(new Connection());
const rcvr = new EventEmitter();
let reqs: AmqpMessage[] = [];
Expand Down Expand Up @@ -126,7 +126,7 @@ describe("RequestResponseLink", function() {
assert.equal(responses[1].correlation_id, reqs[1].message_id);
});

it("should send parellel requests and receive responses correctly (one failure)", async function() {
it("should send parallel requests and receive responses correctly (one failure)", async function() {
const connectionStub = stub(new Connection());
const rcvr = new EventEmitter();
let reqs: AmqpMessage[] = [];
Expand Down