Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id: 85088
Status: rejected
Priority: 0/
Queue: Moo

People
Owner: Nobody in particular
Requestors: olaf [...] wundersolutions.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.002000
Fixed in: (no value)



Subject: weak_ref breaks HTML::Restrict
I added weak_ref to an attribute in the latest version of HTML::Restrict. It's fine in Moo 1.0010000, but it's producing a number of failing reports for Moo 1.0020000. I see that there are some changes to weak_ref in 1.0020000, so I assume that's the root cause. Here are some sample failures: HTML-Restrict-2.1.5: - OpenBSD.amd64-openbsd / 5.16.2: - FAIL http://www.cpantesters.org/cpan/report/8efae756-b53a-11e2-8c80-50d7c5c10595 - OpenBSD.amd64-openbsd / 5.16.3: - FAIL http://www.cpantesters.org/cpan/report/9ef11d90-b596-11e2-8c80-50d7c5c10595 - OpenBSD.amd64-openbsd-thread-multi / 5.16.2: - FAIL http://www.cpantesters.org/cpan/report/555d8672-b56a-11e2-8c80-50d7c5c10595 - OpenBSD.amd64-openbsd-thread-multi / 5.16.3: - FAIL http://www.cpantesters.org/cpan/report/3b4ae508-b5c5-11e2-8c80-50d7c5c10595
This was an explicit change to bring the behavior of weak_ref with lazy attributes in line with Moose.
In older versions of Moo, using weak_ref with lazy attributes would cause the value to be re-calculated for every call to the accessor, no matter what other references there were to the attribute value. The new behavior fixes that, and will cause attributes like this to maintain their value if there is another reference to it outside of the object when the builder/default returns. And once the reference is lost, the attribute will become undef and will not be re-calculated unless cleared. As discussed on IRC, HTML::Restrict was relying on Moo's bug, and was also using weak_ref inappropriately.
Subject: Re: [rt.cpan.org #85088] weak_ref breaks HTML::Restrict
Date: Mon, 6 May 2013 10:04:45 -0700
To: Graham Knop via RT <bug-Moo [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Mon, May 06, 2013 at 11:32:30AM -0400, Graham Knop via RT wrote: Show quoted text
> As discussed on IRC, HTML::Restrict was relying on Moo's bug, and was also using weak_ref inappropriately.
Please add appropriate conflicts entries to Moo's metadata recording this, and call Dist::CheckConflicts from Makefile.PL (see Moose for an example), so users of these modules will know to upgrade when they update Moo.