Merged
Conversation
…ication-library-for-js into v4-track-online-status-change
Contributor
There was a problem hiding this comment.
Pull request overview
Enhances MSAL browser telemetry to capture and count browser online/offline state changes alongside existing page visibility tracking, and surfaces these fields through performance events.
Changes:
- Added
startOnlineStatusandonlineStatusChangeCountto performance telemetry/types. - Refactored
StandardControllerto centrally manage state-change listeners (visibility + online/offline). - Added a unit test to validate capturing online status at measurement start and updated API review outputs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/msal-common/src/telemetry/performance/PerformanceEvent.ts | Adds new performance telemetry fields for online status and online/offline change counts. |
| lib/msal-common/apiReview/msal-common.api.md | Updates public API surface for new telemetry fields and a signature cleanup. |
| lib/msal-browser/src/telemetry/BrowserPerformanceClient.ts | Captures navigator.onLine at measurement start and emits it in the perf event. |
| lib/msal-browser/test/telemetry/BrowserPerformanceClient.spec.ts | Adds coverage for capturing online status at measurement start. |
| lib/msal-browser/src/controllers/StandardController.ts | Tracks and counts online/offline transitions; refactors state-change event listener management. |
| change/@azure-msal-common-8fa830b2-239d-4c03-be8c-ec5db6810878.json | Adds changelog entry for @azure/msal-common. |
| change/@azure-msal-browser-7c8cd0ee-be0c-4aa6-92e5-53e967084f87.json | Adds changelog entry for @azure/msal-browser. |
lib/msal-browser/test/telemetry/BrowserPerformanceClient.spec.ts
Outdated
Show resolved
Hide resolved
Copilot AI
added a commit
that referenced
this pull request
Mar 11, 2026
Co-authored-by: tnorling <[email protected]>
7 tasks
konstantin-msft
previously approved these changes
Mar 11, 2026
konstantin-msft
previously approved these changes
Mar 11, 2026
sameerag
previously approved these changes
Mar 11, 2026
Collaborator
Author
|
@copilot Please update the apiExtractor reports |
Contributor
…es (#8415) API Extractor reports were out of sync with the source changes introduced in this PR. - **`msal-common` API review**: Updated `msal-common.api.md` to reflect the `generateAppMetadataKey` signature change — destructured parameter `{ environment, clientId }` instead of `input: AppMetadataEntity` - **`msal-browser` API review**: Already up to date; no changes needed The `startOnlineStatus` and `onlineStatusChangeCount` fields added to `PerformanceEvent` were already correctly reflected in the previous `apiExtractor` commit. <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: tnorling <[email protected]>
sameerag
approved these changes
Mar 11, 2026
konstantin-msft
approved these changes
Mar 11, 2026
Member
|
@copilot can you rerun the validation checks to merge this PR? |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the MSAL browser library's ability to track and measure browser state changes related to both page visibility and online/offline status. It introduces new telemetry fields, refactors event listener management for improved maintainability, and updates tests and API documentation accordingly.
Browser state change tracking and telemetry improvements:
StandardController, including incrementing a newonlineStatusChangeCountfield in performance measurements. [1] [2] [3] [4] [5]addStateChangeListenersandremoveStateChangeListenersmethods to handle both visibility and online/offline events, improving code maintainability and reducing duplication. [1] [2] [3] [4] [5] [6] [7]Performance measurement enhancements:
BrowserPerformanceClientto capture the browser's online status at the start of a measurement and include it in the telemetry event asstartOnlineStatus. [1] [2] [3]Testing and API documentation:
PerformanceEventto include the newstartOnlineStatusandonlineStatusChangeCountfields. [1] [2]Minor API cleanup:
generateAppMetadataKeyto use a single input parameter for clarity.