Updating Lucee to the recommended 5.4.3.2 via the ...
# lucee
c
Updating Lucee to the recommended 5.4.3.2 via the "fat jar" method where the lucee-5.4.3.2.jar is copied to {lucee}\lib. Is there anything else that needs to be done? I noticed several files in {lucee}\tomcat\lucee-server\bundles with the same names, but different versions (e.g.
org.apache.tika.core-1.20.0.jar
and
org.apache.tika.core-1.28.3.jar
)
I'm asking because upgrading introduced a few bugs in our app and I want to make sure everything is updated properly.
b
@czeller There's no issues with different versions of the same bundle
👍 1
Are your issues related to XML parsing or Query of Queryies?
c
No, one issue is related to serializing certain cfc's to JSON via serializeJSON(). The JSON is malformed. It's not all cfc's though...still trying to work through the distinction.
(hi btw - been a while! 👋)
👋 1
b
Interesting, I'm not aware of any JSON changes in the latest release, unless you were updating from something really old
c
5.3.10
👍 1
b
If the JSON is legit malformed, then Lucee may have simply tightened the screws on some validation there
c
it's actually in the context of testbox/mockbox
Copy code
obj = getMockBox().createMock("somecfc");

dump(serializeJSON(obj));  
	dump(deserializeJSON(serializeJSON(obj)));
b
Can you share the full exception and stack trace?
c
let me see...
b
This works for me on a random CFC instance
Copy code
CFSCRIPT-REPL: f= serializeJSON( new Query() )
{
    "tagName":"query",
    "params":[],
    "parts":[],
    "attributes":{}
}
CFSCRIPT-REPL: deserializejson(f)
{
    "tagName":"query",
    "params":[],
    "parts":[],
    "attributes":{}
}
oh wait, nevermind-- I forgot I downgraded my CLI today while testing. I tested that on 5.3.10!
c
what's the best way to share the stacktrace? slack is telling me it's too long
b
Put it in a snippet
👍 1
Click the "plus" sign
c
Untitled
b
Ahh, so it's erroring on the derialization, not the serialization?
Is the JSON, in fact, valid?
c
Untitled
yeah, because the serialized string isn't valid - looks something like this ☝️
note the series of commas between keys
at least i think that's the problem, lol
b
Hmm, need a reprodicable case
c
let me see if i can get it reproducable
b
I just tried my example serializing and deserialization a query instance and it still works on Lucee 5.4.2
c
it works for me for some objects, just not all. the mocked objects seem to have issues being serialized (or at least a few in our tests)
b
Ok, I can reproduce
Copy code
CFSCRIPT-REPL: qu=new Query()
[Object org.lucee.cfml.Query]
CFSCRIPT-REPL: qu.asdfsdf={}
{}
CFSCRIPT-REPL: serializeJSON( qu )
{"ASDFSDF":{},,,,,,,,"tagName":"query","params":[],"parts":[],"attributes":{}}
When I slap a public property on the CFC instance, it results in invalid JSON 🤔
☝️ I was just running that code in the CommandBox REPL to test
c
very nice!
b
@zackster is out for the day, but we can put in a ticket
Do you want to put in the ticket?
c
yup, i can give it a shot. thanks for all your help!
👍 1
b
I had a search through the tickets with a fix version greater than 5.3.10 but didn't see anything right off. Of course, the ticket may not have been related to JSON specically
c
how do you do that type of search?
b
It requires two PHD's in JIRAololigy
🧠 1
You have to switch from the basic search to thier little search DSL to do a greater than on a version
c
ah, ok. slick
b
Note that also includes tickets fixed in 6, but it's not easy to filter them out as many ticket have both a 5.4 AND a 6.0 fix version on them
c
is this a fair summary statement?
SerializeJSON() produces invalid JSON when the variable is an object with a public method
b
I'm not quite sure that's worded correctly...
I would just say when serializing some CFC instances
And then your example will show a specific instance that has the issue
👍 1
c
b
@czeller There has been some movement on that ticket
c
Thanks for the update! ...Not sure if I'm understanding this right, but it looks like the fix for the SerializeJSON() problem is to allow casting a dot to a number (which is another bug that bit us while trying to upgrade). https://github.com/lucee/Lucee/commit/9f69ae56479317185d2c8cad718019e6ec5ff53e I've coded around both of those bugs with a forked version of Lucee. We are still testing.
b
Hmm, I have seen people discussing that
.
now ==
0
but I understood that to be a different issue
I wonder if MIcha pasted the wrong commit 🤔
Yeah, that's the wrong commit
you can see the commit message is
Copy code
LDEV-4480 - allow to cast a dot to a number
cc @zackster
c
Nice! those match the changes I made 😄