Skip to content

Fix recurring desktop extension errors affecting error diagnostics#1482

Merged
amitjoshi438 merged 5 commits intomainfrom
users/amitjoshi/fix-recurring-desktop-errors
Feb 18, 2026
Merged

Fix recurring desktop extension errors affecting error diagnostics#1482
amitjoshi438 merged 5 commits intomainfrom
users/amitjoshi/fix-recurring-desktop-errors

Conversation

@amitjoshi438
Copy link
Contributor

Summary

  • Binary file exclusion: Expanded getExcludedFileGlobPattern() to exclude 26 additional binary extensions (.dll, .exe, .zip, fonts, etc.) that were causing ValidateTextDocumentEvent errors (21K errors, 78 users)
  • Auth session cooldown: Added 5-second cooldown to onDidChangeSessions handler to break tight retry loops where failed auth triggers another session change (116K errors, 55 users)
  • PreviewSite phase tracking: Added initPhase variable to PreviewSite.initialize() so error telemetry identifies which step failed; replaced unsafe as Error cast with instanceof Error check (16K errors, 5K users)
  • ECS config diagnostics: Included HTTP status in error messages, wrapped response.json() in try-catch, validated result[clientName] before assignment (5K errors, 707 users)
  • WebsiteUtil error handling: Added safeResponseJson() helper, standardized 404 tolerance across all 4 fetch functions, fixed error messages to log actual error instead of event name constant (7K errors, 163-368 users)

Test plan

  • npm run compile-web passes
  • npm run test — 95 unit tests passing
  • npm run test-desktop-int — 842 integration tests passing (including 12 new tests)
  • Verify telemetry improvements via Kusto after deployment

🤖 Generated with Claude Code

Amit Joshi and others added 4 commits February 16, 2026 18:12
Sites without blogs, forums, or ideas provisioned return HTTP 400/404
from Dataverse when fetching these optional entity types. Previously
these were thrown and caught as system errors with message "{}",
producing ~5.4 false errors per session and degrading the read
completion rate from 97% to 77%.

Now, 400/404 responses for conditionalFolderEntities (blogs, blogposts,
ideas, ideaforums, forumannouncements, forumposts) are handled
gracefully with info telemetry instead of error telemetry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Improve error handling across 5 high-impact areas identified via telemetry
(184K errors/30 days): expand binary file exclusion to prevent validation
errors on non-text files, add cooldown to auth session change handler to
break retry loops, add phase tracking to PreviewSite initialization, include
HTTP status in ECS config errors, and standardize WebsiteUtil fetch error
handling with safe JSON parsing and consistent 404 tolerance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses five categories of recurring desktop extension errors affecting error diagnostics by improving error handling, adding tolerance for optional entities, implementing retry loop prevention, and enhancing telemetry reporting.

Changes:

  • Expanded binary file exclusions to prevent ValidateTextDocumentEvent errors on 26 additional binary file types (fonts, executables, archives, etc.)
  • Added 5-second cooldown to authentication session change handler to prevent tight retry loops
  • Enhanced error diagnostics with initPhase tracking in PreviewSite initialization and improved error message details in ECS config fetching
  • Implemented graceful 404/400 handling for optional community entities (blogs, forums, ideas, etc.) with dedicated telemetry
  • Standardized error handling across WebsiteUtil with safeResponseJson helper and safe error type checking

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/web/client/test/integration/remoteFetchProvider.test.ts Added 3 tests for optional entity 404/400 handling and core entity 404 behavior
src/web/client/dal/remoteFetchProvider.ts Added graceful 404/400 handling for optional entities with info telemetry instead of errors
src/common/utilities/WebsiteUtil.ts Replaced unsafe as Error casts with instanceof Error checks, added safeResponseJson helper, and implemented 404 tolerance for app modules and site settings
src/common/ecs-features/ecsFeatureClient.ts Enhanced error messages with HTTP status, added JSON parse error handling, validated config presence, and included clientName in error telemetry
src/common/OneDSLoggerTelemetry/web/client/webExtensionTelemetryEvents.ts Added WEB_EXTENSION_OPTIONAL_ENTITY_NOT_FOUND telemetry event
src/client/test/Integration/power-pages/preview-site/PreviewSite.test.ts Added 3 tests for initPhase tracking in error telemetry
src/client/test/Integration/ecsFeatureClient.test.ts New test file with 6 comprehensive tests for ECS client error scenarios
src/client/test/Integration/WebsiteUtil.test.ts Added 3 tests for 404 handling and JSON parse failures
src/client/power-pages/preview-site/PreviewSite.ts Added initPhase variable for granular error tracking and replaced unsafe error cast
src/client/power-pages/commonUtility.ts Expanded EXCLUDED_BINARY_EXTENSIONS constant from 5 to 26 file types
src/client/extension.ts Added 5-second cooldown mechanism for authentication session change handler

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@amitjoshi438 amitjoshi438 merged commit f6a1a4d into main Feb 18, 2026
8 checks passed
@amitjoshi438 amitjoshi438 deleted the users/amitjoshi/fix-recurring-desktop-errors branch February 18, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments