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

LogEntryEvent__e.RequestId__c field is not being set #424

Closed
chazwatkins opened this issue Dec 2, 2022 · 5 comments · Fixed by #423
Closed

LogEntryEvent__e.RequestId__c field is not being set #424

chazwatkins opened this issue Dec 2, 2022 · 5 comments · Fixed by #423
Assignees
Labels
Layer: Logger Engine Items related to the core logging engine Type: Bug Something isn't working

Comments

@chazwatkins
Copy link
Contributor

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

v4.9.7

New Bug Summary

We upgraded from 4.7.0 to 4.9.7 yesterday and are getting errors from an automation user stating the LogEntryEvent__e.RequestId__c must have a value. The user has all Logger perm sets, which have access to RequestId__c.

The v4.8.4 release notes, where RequestId__c was introduced, don't note any changes required post-installation to utilize RequestId__c.

Any idea what could be causing this error?

Error message

Logger failed to save 1 LogEntryEvent__e records for ...

Error Messages:

You must enter a value: RequestId__c

For a temporary fix, we've set RequestId__c as not a required field.

@chazwatkins chazwatkins added the Type: Bug Something isn't working label Dec 2, 2022
@jongpie
Copy link
Owner

jongpie commented Dec 5, 2022

Hey @chazwatkins thanks for reporting this! The field RequestId__c shouldn't have been flagged as required - I seldomly add fields that should be required, and this field being marked as required was unintentional. I'll update it in the next release (v4.9.8) so that it's no longer required.

However, I'm curious if you were only getting this error some of the time - the field is currently being set to be the value of System.Request.getCurrent().getRequestId(), so I'm wondering if perhaps it's only null in some situations? Does it sometimes work for you?

@jongpie jongpie added the Layer: Logger Engine Items related to the core logging engine label Dec 5, 2022
@jongpie jongpie self-assigned this Dec 5, 2022
@chazwatkins
Copy link
Contributor Author

Hey @jongpie - Thanks for getting back to me so quickly. The error only appears when we fire a platform event and the subscriber transaction, processed using the autoproc user, uses Logger.

@jongpie
Copy link
Owner

jongpie commented Dec 5, 2022

@chazwatkins thanks for the info! That's interesting, I guess it makes sense that the autoproc user doesn't have a request ID, but that wasn't something I had tested before.

I should have the next release v4.9.8 (PR #423) released sometime this week, which will include the change to make the field LogEntryEvent__e.RequestId__c optional.

jongpie added a commit that referenced this issue Dec 7, 2022
* Consolidated LogMassDeleteExtension_Tests_Security class with primary test class LogMassDeleteExtension_Tests

* Cleaned up some of the code in LogEntryEventStreamController and LogEntryEventStreamController_Tests

* Removed an old & used private method in LogEntryEventBuilder

* Updated the LoggerPlugin class to handle Apex classes that don't implement the appropriate interface - this also helped to simplify class LoggerSObjectHandler

* Cleaned up some of the code in LogBatchPurgeController and LogBatchPurgeController_Tests

* Fixed a small bug in LoggerEngineDataSelector that prevented Network data from being queried properly

* Fixed #424 by updating LogEntryEvent__e.RequestId__c to not be required

* Added some additional unit tests in LogEntryEventHandler_Tests, LoggerEngineDataSelector_Tests and LoggerEngineDataSelector_Tests_Network

* Reverting to using sfdx deploy (instead of push) build.yml to try to resolve some issues with extra-tests classes not being deployed to scratch orgs

* Renamed npm scripts 'lint' to 'scan'

* Updated package.json and package-lock.json to resolve a dependabot security alert
@jongpie
Copy link
Owner

jongpie commented Dec 7, 2022

Hey @chazwatkins - this should now be fixed in the newest release v4.9.8. Thanks again for reporting this, and let me know if you run into any other issues!

@chazwatkins
Copy link
Contributor Author

Thanks for the quick turn around on the fix @jongpie.

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

Successfully merging a pull request may close this issue.

2 participants