Merge flash in session and finalize before sending response patches
Tomas Doran [Fri, 9 Jan 2009 01:55:55 +0000 (01:55 +0000)]
1  2  3 
Changes
Makefile.PL
lib/Catalyst/Plugin/Session.pm
t/03_flash.t

diff --cc Changes
+++ b/Changes
@@@@ -1,7 -1,10 -1,7 +1,14 @@@@
   Revision history for Perl extension Catalyst::Plugin::Session
   
---0.20    XXX
+++0.19_01 2009-01-09
+++        - Use shipit to package the dist
           - Switch to Module::install
+ +        - Flash data is now stored inside the session (key "__flash") to avoid
+ +          duplicate entry errors caused by simultaneous select/insert/delete of
 -           flash rows when using DBI as a Store.
+++          flash rows when using DBI as a Store. (Sergio Salvi)
+++        - Fix session finalization order that caused HTTP responses to be sent
+++          before the session is actually finalized and stored in its Store.
+++          (Sergio Salvi)
   
   0.19    2007-10-08
   
diff --cc Makefile.PL
@@@@ -16,6 -16,6 -16,6 +16,7 @@@@ requires 'Digest'
   requires 'File::Spec';
   requires 'File::Temp';
   requires 'Object::Signature';
+++requires 'MRO::Compat';
   
   # an indirect dep. needs a certain version.
   requires 'Tie::RefHash' => '1.34';
@@@@ -13,7 -13,7 -13,7 +13,7 @@@@ use overload            ()
   use Object::Signature   ();
   use Carp;
   
---our $VERSION = '0.20';
+++our $VERSION = '0.19_01';
   
   my @session_data_accessors; # used in delete_session
   BEGIN {
@@@@ -1002,10 -1010,10 -1004,10 +1012,14 @@@@ Andy Grundma
   
   Christian Hansen
   
---Yuval Kogman, C<nothingmuch@woobling.org> (current maintainer)
+++Yuval Kogman, C<nothingmuch@woobling.org>
   
   Sebastian Riedel
   
+++Tomas Doran (t0m) C<bobtfish@bobtfish.net> (current maintainer)
+++
+++Sergio Salvi
+++
   And countless other contributers from #catalyst. Thanks guys!
   
   =head1 COPYRIGHT & LICENSE
diff --cc t/03_flash.t
@@@@ -37,7 -43,9 -37,7 +43,9 @@@@ $c->flash(bar => "gorch")
   
   is_deeply( $c->flash, { foo => "moose", bar => "gorch" }, "two keys in flash" );
   
-  $c->finalize;
+ +cmp_deeply( $c->session, { __updated => re('^\d+$'), __flash => $c->flash }, "session still has __flash with flash data" );
+ +
 - $c->finalize;
++ $c->finalize_body;
   
   is_deeply( $c->flash, { bar => "gorch" }, "one key in flash" );