[jifty-devel] r1806 broke our internal app

Sean E. Millichamp sean at bruenor.org
Mon Aug 14 21:34:06 EDT 2006


On Mon, 2006-08-14 at 13:56 -0400, Jesse Vincent wrote:

> What was your intent with http://svn.jifty.org/index.cgi/jifty/revision/?rev=1806?
> 
> Were you trying to remove the class of the currentuser object entirely?

Hi Jesse,

I originally inquired about this in the post
http://lists.bestpractical.com/pipermail/jifty-devel/2006-August/000559.html and then when I didn't get any feedback I decided that writing both a test showing how I thought it was broken and committing a fix was the best way to proceed and elicit feedback.

Basically, all of my understanding by both the Jifty docs and examples
(Wifty) suggest that all CurrentUser initialization by the app should be
done in the _init() function.

If the _init() function sets either is_bootstrap_user or is_superuser
based on some value in the App::Model::User record that will not be
preserved across the original Jifty::Web current_user session
save/restore since only the user_object is saved/restored and the
user-specific _init never seems to be called again.

If you back out r1806 and run the tests I committed in r1805 and r1807
(part of the same tests, I forgot to commit one file) you will see this
failure.  Test 19 fails.  After Jifty::Web restores the current_user,
is_superuser should still be set but it is not.

Now, if that is NOT how it is supposed to work and the test is invalid
then I apologize.  However, the current_user session save/load change
(in early June I believe) broke my app ;).  If the tests don't match
expected Jifty behavior and you tell me how and where an app is supposed
to make sure is_bootstrap_user and is_superuser get initialized each
time I will modify the docs appropriately.

However, if I am right on with the tests but not quite right with the
fix then I will need some guidance.  I wasn't entirely sure what the
original Jifty::Web code was trying to accomplish.  It seemed overly
complex to me and without seeing your internal app I suppose the
specific fix need for both it and the test I committed might elude me.

Sean

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20060814/20de3d93/attachment.pgp


More information about the jifty-devel mailing list