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

setTransactionQuiddity throws error executing UserInfo.getSessionId() #598

Closed
dvanlooy opened this issue Jan 18, 2024 · 2 comments · Fixed by #604
Closed

setTransactionQuiddity throws error executing UserInfo.getSessionId() #598

dvanlooy opened this issue Jan 18, 2024 · 2 comments · Fixed by #604
Assignees
Labels
bug Something isn't working logger engine Items related to the core logging engine

Comments

@dvanlooy
Copy link

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

4.8.2

New Bug Summary

When a user which is logged in through a (server-to-server) connected app with setting "Issue JSON Web Token (JWT)-based access tokens for named users" true tries to use a Logger.xxx method, a Salesforce System Error is thrown.
Debugging learns that these actions fail on calling System.UserInfo.getSessionId() (used in Logger.setTransactionQuiddity).
Current bypass is to set "Issue JSON Web Token (JWT)-based access tokens for named users" false, or to add try/catch arround System.UserInfo.getSessionId().
Screenshot 2024-01-18 at 11 16 37
Screenshot 2024-01-18 at 10 48 20

Screenshot 2024-01-18 at 11 05 22
@dvanlooy dvanlooy added the bug Something isn't working label Jan 18, 2024
@jongpie
Copy link
Owner

jongpie commented Jan 20, 2024

@dvanlooy thanks for reporting this! @jamessimone and I have made several attempts at trying to work around some of the issues related to sessions, it seems like the fun never ends! 😅

It looks like you're on an older version of Nebula Logger, but even in the newer versions, it's still relying on System.UserInfo.getSessionId() - I like your idea of adding a try/catch around it, that should be fairly simple to implement. I'll work on getting this changed ASAP.

@jongpie jongpie added the logger engine Items related to the core logging engine label Jan 20, 2024
@jongpie jongpie self-assigned this Jan 20, 2024
jongpie added a commit that referenced this issue Jan 20, 2024
jongpie added a commit that referenced this issue Jan 21, 2024
…WT enabled (#604)

* Fixed #598 by adding a try-catch block around the call to System.UserInfo.getSessionId()

* Optimized how Logger.TRANSACTION_QUIDDITY is loaded so it doesn't repeatedly try to load in transactions where there isn't an active quiddity

* Removed some extra copy-pasta in the new LoggerParameter__mdt record DefaultLogEntryRelatedListFieldSet
@jongpie
Copy link
Owner

jongpie commented Jan 21, 2024

@dvanlooy I've just released changes for this in release v4.12.3. Once you're able to upgrade & test it out, please let me know if you run into any more issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logger engine Items related to the core logging engine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants