-
Notifications
You must be signed in to change notification settings - Fork 393
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
Jb/add trace flag auto delete #3812
Conversation
import { Connection } from '@salesforce/core'; | ||
|
||
/** | ||
* TraceFlagsRemover is a singleton which deletes trace flags not created by the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is confusing. Did you mean "deletes trace flags created by the user"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ensureTraceFlags()
, the code checks whether an existing trace flag exists (getTraceFlagForUser()
). If a trace flag doesn't exist, we create a trace flag ourselves (automatically/programmatically). When we create a trace flag, this class (TraceFlagsRemover
) then cleans up and removed the trace flag.
Would, "TraceFlagsRemover is a singleton which deletes trace flags programmatically created when an existing trace flag isn't present" be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ...which deletes trace flags created by the extensions.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm... I'll change it to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
packages/salesforcedx-utils-vscode/test/unit/helpers/traceFlagsRemover.test.ts
Show resolved
Hide resolved
Looking great. I'm good to approve once I can test locally with the .vsix |
What does this PR do?
Implements the auto removal of temporary trace flags.
What issues does this PR fix or reference?
@W-10288383@
Functionality Before
With the new updates to the "SFDX: Launch Apex Replay Debugger with Current File” command, a trace flag was created behind the scenes, but wasn't cleaned up after the debugging session finished.
Functionality After
Now, after finished debugging, if the trace flag was created by the command, it is deleted from the org (existing trace flags are left untouched)