Hi, we're trying to move from cb6->cb7, hit a l...
# box-products
d
Hi, we're trying to move from cb6->cb7, hit a little issue that I'm not sure if is config issue with us, or bug
coldbox 7.0.0+7 issue is
lazyPropertyGetter
invoking
variables["true"]()
, and there's no "true" method, so we fail.
Copy code
// coldbox/System/ioc/builder.cfc
/**
* Dynamic function injected into the targets to provide lazy functions
*/
function lazyPropertyGetter(){
    var propertyName = getFunctionCalledName().reReplaceNoCase( "^get", "" ); // "ORMEVENTHANDLER"

    var withLock = function( propertyName, builder ){
        lock name="wb-lazy-#arguments.propertyName#" type="exclusive" timeout=10 throwOnTimeout=true {
            return arguments.builder( arguments.propertyName );
        }
    };
    var buildProperty = function( propertyName ){
        // Build it out
        variables[ arguments.propertyName ] = invoke(
            variables,
            this.$wbLazyProperties[ arguments.propertyName ].builder // invokes variables["true"], fails
        );
        return variables[ arguments.propertyName ];
    };

    // .........
The $wbLazyProperties evaluates as follows:
Copy code
this.$wbLazyProperties[ arguments.propertyName ] === {
    builder: "true",
    name: "ORMEventHandler",
    useLock: true
}
b
@lmajano
l
Are you using the
lazy
annotation on any property?
that only fires when you are using lazy getters
d
I'm not sure, I don't know where that would be configured. Is there a regex I can search my codebase for to check for it, or something like that?
ah, /** @lazy true */ property ...
l
yes
we introduced lazy getters in cb7
d
there's old code that has those annotations ... we'll remove them and see what happens.
l
let me know if there is anything else David
we will make sure to address it promptly
I know its a major upgrade
some things could have fallen in the cracks
d
digging into this further, there is a lot of old orm code with lazy annotations. Is it possible to disable cb7's "lazy property analyzer"?
l
not really
I mean, we can add something
but it's a major bump
so it requires some upgrade work
d
it would be helpful if the annotation was something like
___cb__lazy_
to namespace it, or dynamic like
lazyAttrName="lazy" /*user configurable*/
l
Well then it would be very ugly. Plus, there is no conflicting metadata name
lazy
in native CFML. If we make that configurable, then every annotation should be configurable, and even more problematic
What if someone doesn't like
inject
or
singleton
Sometimes we have to be opinionated
in the way we structure these decisions
sometimes too many options can be exhaustive and a detriment