Skip to content

Commit 09ad141

Browse files
committed
Merge branch 'development'
2 parents b79c747 + afc399c commit 09ad141

File tree

6 files changed

+53
-18
lines changed

6 files changed

+53
-18
lines changed

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name":"ColdBox Debugger",
33
"author":"Ortus Solutions <[email protected]",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
5-
"version":"3.3.0",
5+
"version":"3.3.1",
66
"slug":"cbdebugger",
77
"type":"modules",
88
"homepage":"https://github.com/coldbox-modules/cbdebugger",

changelog.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
9+
----
10+
11+
## [3.3.1] => 2022-APR-21
12+
13+
### Fixed
14+
15+
* [CBDEBUGGER-17](https://ortussolutions.atlassian.net/browse/CBDEBUGGER-17) If you change the monitor frequency, it does not clear the old monitor and you get n monitors
16+
* [CBDEBUGGER-16](https://ortussolutions.atlassian.net/browse/CBDEBUGGER-16) Left double hash on no state for request tracker profiler
17+
* [CBDEBUGGER-15](https://ortussolutions.atlassian.net/browse/CBDEBUGGER-15) Auto-Refresh is not working in latest version
18+
* [CBDEBUGGER-10](https://ortussolutions.atlassian.net/browse/CBDEBUGGER-10) Executing Event That Uses QB From Interceptor Generates CBDebugger Exception
19+
* [CBDEBUGGER-6](https://ortussolutions.atlassian.net/browse/CBDEBUGGER-6) Stop auto-refresh when visiting a actual request report
20+
821
----
922

10-
## [3.3.0] => 2022
23+
## [3.3.0] => 2022-APR-21
1124

1225
### Added
1326

interceptors/RequestCollector.cfc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,27 @@ component extends="coldbox.system.Interceptor" {
1919
}
2020

2121
/**
22-
* Listen to request captures
22+
* Init the request tracking
2323
*/
24-
function onRequestCapture( event, interceptData, rc, prc ){
24+
private function initRequestTracker( event ){
2525
// The timer hashes are stored here for the request and then destroyed
26-
request.$timerHashes = {};
27-
26+
param request$timerHashes = {};
2827
// init tracker variables for the request
2928
variables.debuggerService.createRequestTracker( event );
29+
}
30+
31+
/**
32+
* Listen to app loads, in case we need to profile app inits and such
33+
*/
34+
function cbLoadInterceptorHelpers( event, interceptData, rc, prc ){
35+
initRequestTracker( event );
36+
}
37+
38+
/**
39+
* Listen to request captures
40+
*/
41+
function onRequestCapture( event, interceptData, rc, prc ){
42+
initRequestTracker( event );
3043

3144
// Determine if we are turning the debugger on/off
3245
if ( structKeyExists( rc, "debugMode" ) AND isBoolean( rc.debugMode ) ) {

models/DebuggerService.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ component
184184
*/
185185
struct function createRequestTracker( required event ){
186186
// Init the request tracers
187-
request.tracers = [];
187+
param request.tracers = [];
188188
// Init the request debugger tracking
189-
request.cbDebugger = {
189+
param request.cbDebugger = {
190190
"coldbox" : {},
191191
"exception" : {},
192192
"executionTime" : 0,

resources/assets/js/cbdebugger.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ window.coldboxDebugger = ( () => {
2525
/**
2626
* Listen to dom load and attach
2727
*/
28-
window.onload = ()=> console.log( "ColdBox Debugger Loaded!" );
28+
window.addEventListener( "load", ( event ) => {
29+
console.log( "ColdBox Debugger Loaded!" );
30+
} );
2931

3032
return {
3133
/**

resources/assets/js/components/RequestTrackerPanel.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
55
usingReinitPassword : hasReinitPassword,
66
isVisualizer : isVisualizer,
77
currentProfileId : "",
8+
refreshMonitor : null,
89

910
reinitFramework(){
1011
this.$refs.reinitLoader.classList.add( "cbd-spinner" );
@@ -21,6 +22,7 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
2122
} );
2223
},
2324
loadProfilerReport( id ){
25+
this.stopDebuggerMonitor();
2426
fetch( `${this.appUrl}cbDebugger/renderProfilerReport`, {
2527
method : "POST",
2628
headers : { "x-Requested-With": "XMLHttpRequest" },
@@ -31,13 +33,13 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
3133
} )
3234
.then( response => response.text() )
3335
.then( html => {
34-
history.pushState( { profileId: id }, null, "##" + id );
36+
history.pushState( { profileId: id }, null, "#" + id );
3537
this.$refs[ "cbd-profilers" ].innerHTML = html;
3638
coldboxDebugger.scrollTo( "cbd-request-tracker" );
3739
} );
3840
},
3941
clearState(){
40-
history.pushState( {}, null, "##" );
42+
history.pushState( {}, null, "#" );
4143
this.currentProfileId = "";
4244
},
4345
refreshProfilers(){
@@ -65,17 +67,22 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
6567
} );
6668
},
6769
stopDebuggerMonitor(){
68-
if ( "cbdRefreshMonitor" in window ){
69-
clearInterval( window.cbdRefreshMonitor );
70-
console.log( "Stopped ColdBox Debugger Profiler Refresh" );
70+
// stop only if loaded
71+
if ( this.refreshMonitor != null ){
72+
clearInterval( this.refreshMonitor );
73+
this.refreshFrequency = 0;
74+
console.info( "Stopped ColdBox Debugger Profiler Refresh" );
7175
}
7276
},
7377
startDebuggerMonitor( frequency ){
74-
if ( frequency == 0 ){
75-
return this.stopDebuggerMonitor();
78+
// Ensure monitor is stopped just in case we are switching frequencies
79+
this.stopDebuggerMonitor();
80+
this.refreshFrequency = frequency;
81+
if ( this.refreshFrequency == 0 ){
82+
return;
7683
}
77-
window.cbdRefreshMonitor = setInterval( this.refreshProfilers, frequency * 1000 );
78-
console.log( "Started ColdBox Debugger Profiler Refresh using " + frequency + " seconds" );
84+
this.refreshMonitor = setInterval( () => this.refreshProfilers(), this.refreshFrequency * 1000 );
85+
console.info( "Started ColdBox Debugger Profiler Refresh using " + this.refreshFrequency + " seconds" );
7986
},
8087
init(){
8188
window.addEventListener( "popstate", e => {

0 commit comments

Comments
 (0)