Skip to content

[W-18589337] refactor: turn on apex debug log for replay debugger without calling the CLI command #6386

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

Merged
merged 84 commits into from
Jul 1, 2025

Conversation

daphne-sfdc
Copy link
Contributor

What does this PR do?

  1. Refactors the code for SFDX: Turn On Apex Debug Log for Replay Debugger to not call the CLI command.
  2. Corrects existing bugs in the behavior when switching between orgs. The following use cases were tested in addition to the sunny day cases:
    a. Reload the VSCode window
    b. Handle expired trace flags
    c. Set a default org
    d. Authorize to an org
    e. Logout from an org
    f. Create a scratch org
    g. Delete a scratch org

Test plan here: https://salesforce.quip.com/J7TIA322cOdj

What issues does this PR fix or reference?

@W-18589337@

daphne-sfdc and others added 30 commits May 27, 2025 18:08
connection.singleRecordQuery() does not recognize the DebugLevel metadata type
INVALID_TYPE: sObject type 'DebugLevel' is not supported.

This reverts commit 9e2ed98.
…turn off Apex debug logging when no trace flag is present
@daphne-sfdc daphne-sfdc requested a review from a team as a code owner June 28, 2025 04:23
Copy link
Contributor

@peternhale peternhale left a comment

Choose a reason for hiding this comment

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

Just an observation

@mshanemc
Copy link
Contributor

QA: turned on debugging,
✅ I see the bottom bar element.
✅ logs are generated

turn off debug logs via command
✅ element disappears
sf data:query --query "SELECT Id FROM ApexDebuggerSession WHERE Status = 'Active' LIMIT 1" --use-tooling-api --json produces no results

turn on debugging
delete scratch org
✅ element disappears

seems good!

@daphne-sfdc daphne-sfdc requested a review from mshanemc July 1, 2025 01:56
@mshanemc mshanemc merged commit 8acf90c into develop Jul 1, 2025
8 checks passed
@mshanemc mshanemc deleted the daphne/W-18589337-turn-on-apex-debug-logs-part2 branch July 1, 2025 13:09
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.

3 participants