From 690fa3f19fc1fd930bf191415e17a44051d4fae7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:35:13 +0000 Subject: [PATCH 1/4] Initial plan From 974b21e24d5e79ef5d9e1bb8c923bd8d746c3fd0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:37:37 +0000 Subject: [PATCH 2/4] fix: initialize bootstrap appHash before reload checks --- system/Bootstrap.cfc | 4 +-- tests/specs/BootstrapTest.cfc | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tests/specs/BootstrapTest.cfc diff --git a/system/Bootstrap.cfc b/system/Bootstrap.cfc index d5d73f415..afa4f897e 100644 --- a/system/Bootstrap.cfc +++ b/system/Bootstrap.cfc @@ -33,6 +33,7 @@ component serializable="false" accessors="true" { param name="COLDBOX_APP_KEY" default="cbController"; param name="COLDBOX_APP_MAPPING" default=""; param name="COLDBOX_WEB_MAPPING" default=""; + param name="appHash" default="#hash( getBaseTemplatePath() & application.applicationname )#"; param name="lockTimeout" default="30" type="numeric"; param name="COLDBOX_FAIL_FAST" default="true"; @@ -77,9 +78,6 @@ component serializable="false" accessors="true" { var appKey = locateAppKey() var startTime = getTickCount() - // Param the incoming app hash - param name="appHash" default="#hash( getBaseTemplatePath() & application.applicationname )#"; - // Cleanup of old code, just in case if ( structKeyExists( application, appKey ) ) { structDelete( application, appKey ) diff --git a/tests/specs/BootstrapTest.cfc b/tests/specs/BootstrapTest.cfc new file mode 100644 index 000000000..e68fba636 --- /dev/null +++ b/tests/specs/BootstrapTest.cfc @@ -0,0 +1,62 @@ +component extends="coldbox.system.testing.BaseModelTest" { + + function run( testResults, testBox ){ + describe( "Bootstrap", function(){ + beforeEach( function(){ + param name="application.applicationname" default="cbTestHarness" + + structDelete( application, "cbController" ) + structDelete( application, "fwReinit" ) + structDelete( request, "cb_requestContext" ) + structDelete( url, "fwreinit" ) + } ) + + afterEach( function(){ + structDelete( application, "cbController" ) + structDelete( application, "fwReinit" ) + structDelete( request, "cb_requestContext" ) + structDelete( url, "fwreinit" ) + } ) + + it( "initializes appHash before loadColdBox runs", function(){ + var bootstrap = createMock( "coldbox.system.Bootstrap" ).init( + "/cbtestharness/config/Coldbox.cfc", + expandPath( "/coldbox/test-harness" ), + "cbController" + ) + + expect( bootstrap.getAppHash() ).toBe( hash( getBaseTemplatePath() & application.applicationname ) ) + } ) + + it( "can enter reloadChecks before loadColdBox initializes the framework", function(){ + var bootstrap = createMock( "coldbox.system.Bootstrap" ).init( + "/cbtestharness/config/Coldbox.cfc", + expandPath( "/coldbox/test-harness" ), + "cbController" + ) + var mockController = createEmptyMock( "coldbox.system.web.Controller" ) + + mockController + .$( "getColdboxInitiated" ) + .$results( false, true ) + .$( "getSetting" ) + .$args( "Wirebox" ) + .$results( { singletonReload : false } ) + .$( "getSetting" ) + .$args( "HandlersIndexAutoReload" ) + .$results( false ) + + application.cbController = mockController + + bootstrap + .$( "locateAppKey", "cbController" ) + .$( "isfwReinit", false ) + + bootstrap.reloadChecks() + + expect( bootstrap.getAppHash() ).notToBeEmpty() + } ) + } ) + } + +} From 17849826ee293fe3c5cacec7fbeb08307be32fe1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:38:09 +0000 Subject: [PATCH 3/4] test: align bootstrap spec app name casing --- tests/specs/BootstrapTest.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/specs/BootstrapTest.cfc b/tests/specs/BootstrapTest.cfc index e68fba636..1e117f39f 100644 --- a/tests/specs/BootstrapTest.cfc +++ b/tests/specs/BootstrapTest.cfc @@ -3,7 +3,7 @@ component extends="coldbox.system.testing.BaseModelTest" { function run( testResults, testBox ){ describe( "Bootstrap", function(){ beforeEach( function(){ - param name="application.applicationname" default="cbTestHarness" + param name="application.applicationname" default="cbtestharness" structDelete( application, "cbController" ) structDelete( application, "fwReinit" ) From cfbde0a986f062730eff24325ed68d0cb079d4fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:44:07 +0000 Subject: [PATCH 4/4] fix: initialize bootstrap appHash during init --- system/Bootstrap.cfc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/Bootstrap.cfc b/system/Bootstrap.cfc index afa4f897e..855b9a713 100644 --- a/system/Bootstrap.cfc +++ b/system/Bootstrap.cfc @@ -33,7 +33,7 @@ component serializable="false" accessors="true" { param name="COLDBOX_APP_KEY" default="cbController"; param name="COLDBOX_APP_MAPPING" default=""; param name="COLDBOX_WEB_MAPPING" default=""; - param name="appHash" default="#hash( getBaseTemplatePath() & application.applicationname )#"; + param name="appHash" default=""; param name="lockTimeout" default="30" type="numeric"; param name="COLDBOX_FAIL_FAST" default="true"; @@ -60,6 +60,7 @@ component serializable="false" accessors="true" { variables.COLDBOX_APP_MAPPING = arguments.COLDBOX_APP_MAPPING variables.COLDBOX_WEB_MAPPING = arguments.COLDBOX_WEB_MAPPING variables.COLDBOX_FAIL_FAST = arguments.COLDBOX_FAIL_FAST + variables.appHash = hash( getBaseTemplatePath() & application.applicationname ) // App Key Check if ( structKeyExists( arguments, "COLDBOX_APP_KEY" ) AND len( trim( arguments.COLDBOX_APP_KEY ) ) ) {