Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix typos #5531",
"packageName": "@azure/msal-browser",
"email": "bmahal@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix typos #5531",
"packageName": "@azure/msal-common",
"email": "bmahal@microsoft.com",
"dependentChangeType": "patch"
}
6 changes: 3 additions & 3 deletions lib/msal-browser/src/app/PublicClientApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class PublicClientApplication extends ClientApplication implements IPubli
*/
protected async acquireTokenSilentAsync(request: SilentRequest, account: AccountInfo): Promise<AuthenticationResult>{
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);
const astsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
const atsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);

let result: Promise<AuthenticationResult>;
if (NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId) {
Expand Down Expand Up @@ -242,7 +242,7 @@ export class PublicClientApplication extends ClientApplication implements IPubli

return result.then((response) => {
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);
astsAsyncMeasurement.endMeasurement({
atsAsyncMeasurement.endMeasurement({
success: true,
fromCache: response.fromCache,
isNativeBroker: response.fromNativeBroker,
Expand All @@ -251,7 +251,7 @@ export class PublicClientApplication extends ClientApplication implements IPubli
return response;
}).catch((tokenRenewalError: AuthError) => {
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);
astsAsyncMeasurement.endMeasurement({
atsAsyncMeasurement.endMeasurement({
errorCode: tokenRenewalError.errorCode,
subErrorCode: tokenRenewalError.subError,
success: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class BrowserPerformanceClient extends PerformanceClient implements IPerf
this.guidGenerator = new GuidGenerator(this.browserCrypto);
}

startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement {
startPerformanceMeasurement(measureName: string, correlationId: string): IPerformanceMeasurement {
return new BrowserPerformanceMeasurement(measureName, correlationId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("BrowserPerformanceClient.ts", () => {
expect(typeof browserPerfClient.generateId()).toBe("string");
});
});
describe("startPerformanceMeasuremeant", () => {
describe("startPerformanceMeasurement", () => {
it("calculate performance duration", () => {
const browserPerfClient = new BrowserPerformanceClient(clientId, authority, logger, name, version, applicationTelemetry, cryptoOptions);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export interface IPerformanceClient {
removePerformanceCallback(callbackId: string): boolean;
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
emitEvents(events: PerformanceEvent[], correlationId: string): void;
startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;
startPerformanceMeasurement(measureName: string, correlationId: string): IPerformanceMeasurement;
generateId(): string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
* @param {string} correlationId
* @returns {IPerformanceMeasurement}
*/
abstract startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;
abstract startPerformanceMeasurement(measureName: string, correlationId: string): IPerformanceMeasurement;

/**
* Generates and returns a unique id, typically a guid.
Expand All @@ -97,7 +97,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
}

this.logger.trace(`PerformanceClient: Performance measurement started for ${measureName}`, eventCorrelationId);
const performanceMeasurement = this.startPerformanceMeasuremeant(measureName, eventCorrelationId);
const performanceMeasurement = this.startPerformanceMeasurement(measureName, eventCorrelationId);
performanceMeasurement.startMeasurement();

const inProgressEvent: PerformanceEvent = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class StubPerformanceClient extends PerformanceClient implements IPerform
return "callback-id";
}

startPerformanceMeasuremeant(): IPerformanceMeasurement {
startPerformanceMeasurement(): IPerformanceMeasurement {
return new StubPerformanceMeasurement();
}
}
4 changes: 2 additions & 2 deletions lib/msal-common/test/client/AuthorizationCodeClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@ describe("AuthorizationCodeClient unit tests", () => {
removePerformanceCallback: jest.fn(),
addPerformanceCallback: jest.fn(),
emitEvents: jest.fn(),
startPerformanceMeasuremeant: jest.fn(),
startPerformanceMeasurement: jest.fn(),
generateId: jest.fn()
}
performanceClient.startMeasurement.mockImplementation(() => {
Expand Down Expand Up @@ -2071,7 +2071,7 @@ describe("AuthorizationCodeClient unit tests", () => {
removePerformanceCallback: jest.fn(),
addPerformanceCallback: jest.fn(),
emitEvents: jest.fn(),
startPerformanceMeasuremeant: jest.fn(),
startPerformanceMeasurement: jest.fn(),
generateId: jest.fn()
}
performanceClient.startMeasurement.mockImplementation(() => {
Expand Down
4 changes: 2 additions & 2 deletions lib/msal-common/test/client/RefreshTokenClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ describe("RefreshTokenClient unit tests", () => {
removePerformanceCallback: jest.fn(),
addPerformanceCallback: jest.fn(),
emitEvents: jest.fn(),
startPerformanceMeasuremeant: jest.fn(),
startPerformanceMeasurement: jest.fn(),
generateId: jest.fn()
}
performanceClient.startMeasurement.mockImplementation(() => {
Expand Down Expand Up @@ -536,7 +536,7 @@ describe("RefreshTokenClient unit tests", () => {
removePerformanceCallback: jest.fn(),
addPerformanceCallback: jest.fn(),
emitEvents: jest.fn(),
startPerformanceMeasuremeant: jest.fn(),
startPerformanceMeasurement: jest.fn(),
generateId: jest.fn()
}
performanceClient.startMeasurement.mockImplementation(() => {
Expand Down
4 changes: 2 additions & 2 deletions lib/msal-common/test/telemetry/PerformanceClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ class MockPerformanceClient extends PerformanceClient implements IPerformanceCli
return this.guidGenerator.generateGuid();
}

startPerformanceMeasuremeant(measureName: string, correlationId?: string): IPerformanceMeasurement {
startPerformanceMeasurement(measureName: string, correlationId?: string): IPerformanceMeasurement {
return new MockPerformanceMeasurement();
}
}

class UnsupportedBrowserPerformanceClient extends MockPerformanceClient {
startPerformanceMeasuremeant(measureName: string, correlationId?: string): IPerformanceMeasurement {
startPerformanceMeasurement(measureName: string, correlationId?: string): IPerformanceMeasurement {
return new UnsupportedBrowserPerformanceMeasurement();
}
}
Expand Down