Skip to content

Conversation

@amitjoshi438
Copy link
Contributor

@amitjoshi438 amitjoshi438 commented Dec 16, 2025

This pull request introduces major improvements to the Server Logic debugging experience in Power Pages by enabling direct Dataverse API calls during debugging when authenticated, and refactoring the debugger activation for better integration with authentication. The changes ensure that, when authenticated via the PAC CLI, server logic code can call Dataverse APIs directly using real credentials; otherwise, mock responses are returned. The activation and command handling logic for the debugger has been updated to support this, along with enhanced telemetry and error handling.

Server Logic Debugger & Authentication Integration:

  • Refactored the activateServerLogicDebugger function to accept a PacWrapper parameter, enabling automatic retrieval of Dataverse credentials for real API calls during debugging. This includes new helper functions for credential retrieval and validation of server logic files. (src/debugger/server-logic/ServerLogicDebugger.ts, src/client/extension.ts) [1] [2] [3] [4]
  • Updated the command registration and removed the powerpages.debugServerLogic command from the navigation menu to prevent it from appearing in inappropriate contexts. (package.json)

Dataverse API Call Support in Mock SDK:

  • Enhanced the generateServerMockSdk function to support direct Dataverse API calls (CRUD and custom API) using credentials injected via environment variables during debugging. If not authenticated, the SDK falls back to returning mock responses. (src/debugger/server-logic/ServerLogicMockSdk.ts) [1] [2] [3] [4] [5] [6] [7] [8]

Telemetry and Error Handling:

  • Added new telemetry event SERVER_LOGIC_AUTH_ERROR to track authentication failures when retrieving Dataverse credentials. Telemetry for debug and run commands now includes whether real credentials were used. (src/common/OneDSLoggerTelemetry/client/desktopExtensionTelemetryEventNames.ts, src/debugger/server-logic/ServerLogicDebugger.ts) [1] [2] [3]

These changes provide a more realistic and seamless debugging experience for server logic, improve error visibility, and streamline command handling for developers.

@amitjoshi438 amitjoshi438 requested review from a team as code owners December 16, 2025 06:48
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