Skip to content

v4.18.4 - Bugfix: Removed most of the usage of UserInfo.getSessionId()

Choose a tag to compare

@jongpie jongpie released this 07 Jul 17:48
· 8 commits to main since this release
55ba832

Thanks so much to everyone that helped with troubleshooting & testing issues #761 and #964, including @krishnandusarkarprax, @JeroenSfdc, @arafesthain, @Ben-Culver, @victorkuldeep, @mmablom, and @NitishFCTG!

Core Unlocked Package Changes

Fixed #761 and fixed #964 by updating Logger Apex class to remove most of the usage of System.UserInfo.getSessionId() - it can't cause problems if we don't use it 😆

  • Now the only place that the session ID is referenced is when using the REST save method. The user session ID is synchronously passed to the internal class RestApiSaver - and passing it like this will (intentionally) force a synchronous runtime exception when there isn't a session ID (instead of it silently failing async)
    • Issue #996 has been created to add the ability to specify a named credential to use when making internal REST calls to the org (which would effectively eliminate the last usage of System.UserInfo.getSessionId())

To help validate that this change doesn't cause any regressions, I've added some extra metadata (used only in the pipeline & testing) to recreate previously reported issues related to quiddity & user session ID:

  • Issue #155 - Added an example email service, ExampleInboundEmailService, to have a full solution to re-test. Previously, I only had the Apex class ExampleInboundEmailHandler, but I needed the service itself to do a full end-to-end test.
  • Issue #224 - Added Experience Cloud metadata SSO logins, auth provider, and custom registration handlers, to have a full solution to re-test.

With the extra metadata in place & the changes in Logger, everything still seems to be working as expected (without the use of System.UserInfo.getSessionId()).

Pipeline Changes

Pipeline overhaul: made some big restructuring of .github/workflows/build.yml for maintainability and speed improvements

  • Made two composite actions (setup-npm and authorize-dev-hub) for some stuff that's used throughout the build (and was previously duplicated a bunch)
  • Pulled out the scratch-org test logic into a reusable workflow (test-scratch-org.yml), with parameters to control scratch def file, OmniStudio toggle, optional extra-metadata directory, and Codecov toggle
  • Updated build.yml to use the new actions & workflows, which eliminates a ton of duplication
  • Moved the scratch org tests a single matrix-driven caller. Adding a new scratch org now just requires a few new lines to be added to the matrix.
  • All scratch orgs now run in parallel instead of in batches of 3 (a huge thanks to thanks @jamessimone and @mitchspano for getting the dev hub limit increased 🥳)
  • Added a new state-and-country-picklists scratch org as a small follow-up to issue #976
  • Added a new hourly cleanup workflow (delete-stale-scratch-orgs.yml) to delete orphaned pipeline scratch orgs older than 2 hours (it'll skip any scratch orgs tied to GitHub Actions that are still running)

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.18.3...v4.18.4