Skip to content
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

Apex Replay Debugger not showing the content of variables correctly #5719

Open
albarivas opened this issue Aug 12, 2024 · 8 comments
Open

Apex Replay Debugger not showing the content of variables correctly #5719

albarivas opened this issue Aug 12, 2024 · 8 comments
Assignees

Comments

@albarivas
Copy link

albarivas commented Aug 12, 2024

Summary

Trying to debug some Apex code, Apex replay debugger does not show the content of some variables, while System.debug does.

Steps To Reproduce:

Try to debug this code:

public with sharing class NewsletterGenerator {
    @AuraEnabled
    public static String generateNewsletter(String eventId) {
        Map<String, String> event = new Map<String, String>();
        event.put('id', eventId);

        ConnectApi.WrappedValue eventValue = new ConnectApi.WrappedValue();
        eventValue.value = event;

        System.debug('ALBA debug:' + event);
        System.debug('ALBA debug:' + eventValue);

        return '';
    }
}

Expected result

event and eventValue should show a value inside the replay debugger panel, same as I can see the value of those variables through system.debug:

Screenshot 2024-08-12 at 15 59 11

Actual result

Screenshot 2024-08-12 at 15 59 43

Additional information

Feel free to attach a screenshot.

Salesforce Extension Version in VS Code: v61.8.1

Salesforce CLI Version: 2.53.6

OS and version: Mac OS 14.6.1 (23G93)

VS Code version: Version: 1.92.1 (Universal)

Most recent version of the extensions where this was working:

@svc-idee-bot
Copy link
Collaborator

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@CristiCanizales
Copy link
Contributor

Hi @albarivas, I have not been able to reproduce this issue. When you mention you're trying to debug some apex code, what are the exact steps you follow for the same?

@diyer
Copy link
Collaborator

diyer commented Aug 13, 2024

Hi @albarivas, can you provide us with your debug log to see what is going on?

@albarivas
Copy link
Author

What I did was:

1- Deployed the NewsletterGenerator class (with a few more lines after the code I pasted, that are not important for debugging)
2-Started the apex replay debugger
3-Launched an action on my org that called the class
4-Downloaded the debug log (attached)
5- Launched apex replay debugger with the log file

And then I got the result you see on the screen, the event variable looks empty in the replay debugger, while if you take a look at the system.debug statement on the debug log it's not.

07L4U00003r7nT3UAI.log

Let me know if it helps!

@CristiCanizales
Copy link
Contributor

I was able to repro with that log file. My question now though is if in step 2 you meant you started Apex Interactive Debugger, is that the case?

@albarivas
Copy link
Author

albarivas commented Aug 13, 2024

@CristiCanizales it's the apex replay debugger, started capturing logs is probably more correct :)

Copy link

git2gus bot commented Aug 13, 2024

This issue has been linked to a new work item: W-16483547

@CristiCanizales
Copy link
Contributor

I was able to reproduce this issue and have created a Bug ⬆️ to address it. Thank you for bringing it to our attention!

@CristiCanizales CristiCanizales self-assigned this Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants