You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Davies,Douglas" <da...@oclc.org> on 2014/12/03 20:23:02 UTC
renderDebug
Hi guys. While working up a solution for SHINDIG-1984 I noticed that in commoncontainer that renderDebug is set as follows
testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] = '0';
and then in container.js it does this
this.renderDebug_ = (typeof param === 'undefined') ?
Boolean(osapi.container.util.getSafeJsonValue(config,
osapi.container.ContainerConfig.RENDER_DEBUG, false)) :
(param === '1');
which sets this.renderDebug_ to TRUE (incorrectly). I think the creation of the Boolean is only caring that the string has a value and setting to TRUE.
Is this a container/documentation error and we should fix the containers OR should the container.js code be able to handle the string? I can submit a bug once we decide the correct approach. For now I am changing my container to set RENDER_DEBUG to 0 (no quotes) so that I can continue working up a patch for SHINDIG-1984 (which relies on turning off renderDebug so that caching is enabled and I can reproduce my scenario).
Thanks,
Doug Davies
Re: renderDebug
Posted by Stanton Sievers <ss...@apache.org>.
We should be more explicit and just set it to "false" (no quotes). There
are a lot of places where we use 0 or 1 to indicate a boolean value when I
don't think there's really a good reason to do so in favor of true/false.
On Fri, Dec 5, 2014 at 9:04 PM, Ryan Baxter <rb...@gmail.com> wrote:
> I think you are right Doug,
> testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] should be set
> to 0 which would cause Boolean to return false.
>
> On Wed, Dec 3, 2014 at 2:23 PM, Davies,Douglas <da...@oclc.org> wrote:
> > Hi guys. While working up a solution for SHINDIG-1984 I noticed that in
> commoncontainer that renderDebug is set as follows
> >
> > testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] = '0';
> >
> > and then in container.js it does this
> >
> > this.renderDebug_ = (typeof param === 'undefined') ?
> > Boolean(osapi.container.util.getSafeJsonValue(config,
> > osapi.container.ContainerConfig.RENDER_DEBUG, false)) :
> > (param === '1');
> >
> > which sets this.renderDebug_ to TRUE (incorrectly). I think the
> creation of the Boolean is only caring that the string has a value and
> setting to TRUE.
> >
> > Is this a container/documentation error and we should fix the containers
> OR should the container.js code be able to handle the string? I can submit
> a bug once we decide the correct approach. For now I am changing my
> container to set RENDER_DEBUG to 0 (no quotes) so that I can continue
> working up a patch for SHINDIG-1984 (which relies on turning off
> renderDebug so that caching is enabled and I can reproduce my scenario).
> >
> > Thanks,
> > Doug Davies
> >
> >
>
Re: renderDebug
Posted by Ryan Baxter <rb...@gmail.com>.
I think you are right Doug,
testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] should be set
to 0 which would cause Boolean to return false.
On Wed, Dec 3, 2014 at 2:23 PM, Davies,Douglas <da...@oclc.org> wrote:
> Hi guys. While working up a solution for SHINDIG-1984 I noticed that in commoncontainer that renderDebug is set as follows
>
> testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] = '0';
>
> and then in container.js it does this
>
> this.renderDebug_ = (typeof param === 'undefined') ?
> Boolean(osapi.container.util.getSafeJsonValue(config,
> osapi.container.ContainerConfig.RENDER_DEBUG, false)) :
> (param === '1');
>
> which sets this.renderDebug_ to TRUE (incorrectly). I think the creation of the Boolean is only caring that the string has a value and setting to TRUE.
>
> Is this a container/documentation error and we should fix the containers OR should the container.js code be able to handle the string? I can submit a bug once we decide the correct approach. For now I am changing my container to set RENDER_DEBUG to 0 (no quotes) so that I can continue working up a patch for SHINDIG-1984 (which relies on turning off renderDebug so that caching is enabled and I can reproduce my scenario).
>
> Thanks,
> Doug Davies
>
>