Skip to content

Commit

Permalink
fix var scoping
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Dec 25, 2024
1 parent b7b128a commit 115f855
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed - [Issue #37](https://github.com/coldbox-modules/sentry/issues/37) - Fix var-scoping inside conditional

## [2.1.4] - 2024-12-24

### Fixed - [Issue #37](https://github.com/coldbox-modules/sentry/issues/37) - Resolves an ACF incompat issue where traceparent variable was not available in threaded logging
Expand Down
5 changes: 2 additions & 3 deletions models/SentryService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ component accessors=true singleton {
var header = "";
var timeVars = getTimeVars();
var httpRequestData = getHTTPDataForRequest();
var traceParent = httpRequestData.headers.traceParent ?: "";

// Add global metadata
arguments.captureStruct[ "event_id" ] = lCase( replace( createUUID(), "-", "", "all" ) );
Expand All @@ -673,7 +674,6 @@ component accessors=true singleton {
var thisUserInfo = { "ip_address" : getRealIP() };

var userInfoUDF = getUserInfoUDF();
var traceParent = "";
// If there is a closure to produce user info, call it
if ( isCustomFunction( userInfoUDF ) ) {
// Check for a non-ColdBox context
Expand All @@ -691,8 +691,7 @@ component accessors=true singleton {
);
}

// Assemble any trace parent data
var traceParent = httpRequestData.headers.traceParent ?: "";
// Assemble any trace parent data from coldbox
if ( !len( traceParent ) && !isNull( coldbox ) ) {
// Append any trace information which might be provided the `cbotel` module
var prc = coldbox
Expand Down

0 comments on commit 115f855

Please sign in to comment.