Re: [mh] %Save data corruption when using MQTT

Dave Neudoerffer <[email protected]> Sun, 3 Sep 2023 13:19:33 -0400
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <CAOFx8LMopA73DrcF=B8KHi6hz7TXHfhBiyO=dRLUchH+9bLpPw@mail.gmail.com>
Crap, that was me.  Sorry all.  I have submitted a pull request to remove
the setting of Maxdepth.  If someone can merge, that would be great.

Dave

On Sun, Sep 3, 2023 at 12:30 PM Brian M <[email protected]>
wrote:

> Just an FYI at this point ...
>
> I've discovered that %Save can become corrupted if mqtt_items.pm (or
> apparently mqtt_discovery.pm) are used. The reason is that these two
> contain:
>
> $Data::Dumper::Maxdepth = 3;
>
> That statement changed the maximum output depth that Data::Dumper dumps
> to three levels, but it does it *globally*. Since the routine to write
> %Save to disk uses Data::Dumper, any data stored in %Save that goes
> deeper than three (and I have several) get the lower nodes replaced with
> "HASH(0x...)" or "ARRAY(0x...)". Obviously, those don't restore well on
> restart.
>
> There are object-oriented calls to Data::Dumper that, I believe, keep
> changes to Maxdepth localized to the object, so that would be a possible
> way to correct the code. I'd do it, but I've got a house guest this
> week, so no time.
>
> It took me a long time to determine why some unrelated code of mine was
> suddenly getting garbage in its %Save data, so I thought I should put
> out an alert. Hopefully, this will save some future MQTT user some pain,
> if it doesn't get fixed right away.
>
>                       -Brian M.
>
>
>
> ________________________________________________________
> To unsubscribe from this list, go to:
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>
>

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users