Coder Social home page Coder Social logo

Comments (18)

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

anyone?

from bugloghq.

oarevalo avatar oarevalo commented on September 1, 2024

@KrunchMuffin checkpoints should work "out of the box". Can you try going to the listener test page and trigger a message? The test message will include a checkpoint that should be visible on the report.
( settings -> BugLog Listeners -> Test )

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

I got the exact same blank checkpoint table

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

Would really like to find out what is going on?

from bugloghq.

oarevalo avatar oarevalo commented on September 1, 2024

that is very strange. You could try setting other things on the request scope and then do cfdumps in several places to see where it is being wiped out.
Could it be that the buglog client is being reinitialized?

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

I set it once in app scope, I don't think it would be getting reset.

I set up a test page with just this code

<cfset application.buglog.checkpoint("test checkpoint")>
<cfdump var="#request#">
<cftry>
<cfset foo = x>
<cfcatch>
<cfset application.buglog.notifyService("Test BL", cfcatch, request)>
</cfcatch>
</cftry>

__buglog_checkpoints__ was empty array
and checkpoints was blank

from bugloghq.

oarevalo avatar oarevalo commented on September 1, 2024

what if you dump requests. __buglog_checkpoints__ on each call to checkpoint and then call it multiple times?

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

so this

<cfset application.buglog.checkpoint("test checkpoint")>
<cfdump var="#request.__buglog_checkpoints__#">

<cfset application.buglog.checkpoint("test checkpoint2")>
<cfdump var="#request.__buglog_checkpoints__#">

<cfset request["__buglog_checkpoints__"] = []>
<cfset request["__buglog_checkpoints__"][1] = {ts=gettickcount(),cp="foo"}>

<cfset application.buglog.checkpoint("test checkpoint3")>
<cfdump var="#request.__buglog_checkpoints__#">

yields this

image

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

I am correct in assuming that this code is NOT putting checkpoints back into the request scope?

<cffunction name="checkpoint" access="public" returntype="void" hint="marks a checkpoint in the current request">
    <cfargument name="checkpoint" type="string" required="true">
    <cfscript>
        var checkpoints = getCheckpoints();
        var item = {
            ts = getTickCount(),
            cp = arguments.checkpoint
        };
        arrayAppend(checkpoints, item);
    </cfscript>
</cffunction>

as soon as I add this after </cfscript>, it works.

<cfset request[checkpointsKey] = checkpoints>

from bugloghq.

oarevalo avatar oarevalo commented on September 1, 2024

Well, it is supposed to be operating on a reference to the array on the request scope, and so far since this code was released, it always worked as expected.

It looks like something is making it pass the variable by value instead of by reference on the call to getCheckpoints()

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

I am on CF11. I am sure someone must be using checkpoints on CF11 as well?

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

Was justing reading up and from what I can tell Arrays are always passed by value.

Arrays are complex data types, but for historical reasons (and - IMO - a bad decision on the part of Macromedia's CF team) arrays are actually passed by value in ColdFusion.

http://blog.adamcameron.me/2012/08/complex-data-types-in-cf-and-how-theyre.html
http://www.bennadel.com/blog/275-passing-arrays-by-reference-in-coldfusion---sweeet.htm

But doesn't explain how it can be working for others?

from bugloghq.

oarevalo avatar oarevalo commented on September 1, 2024

hmm, I do most of my dev on Railo so that may be a difference.

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

ahhh, yes, Railo did fix that...

from bugloghq.

oarevalo avatar oarevalo commented on September 1, 2024

in any case it should be an easy fix. I can do an update to the checkpoints, or if you send me a PR that might be faster :)

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

ok, PR sent #138

from bugloghq.

oarevalo avatar oarevalo commented on September 1, 2024

Merged into release 1.8.8
https://github.com/oarevalo/BugLogHQ/releases/tag/v.1.8.8

from bugloghq.

KrunchMuffin avatar KrunchMuffin commented on September 1, 2024

Thanks!

from bugloghq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.