<div class="gmail_quote">On Thu, Apr 2, 2009 at 11:31 PM, Sebastian Sastre <span dir="ltr">&lt;<a href="mailto:ssastre@seaswork.com">ssastre@seaswork.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Folks, just for the record:<br>
I&#39;ve found a cause of problems unless you&#39;re prepared:<br>
<br>
I was using a block with ifCurtailed: wrapping the process of action and<br>
rendering. By wrapping I mean someting about a filter depends on it.<br>
<br>
Incidentally, the ifCurtailed: was basically there to make a rollback and/or<br>
unlock any locked objects of a non flawless transaction.<br>
So, to prevent surprises, developers must expect WAResponseNotification at any<br>
time. This means that a non resumable notification will be triggered at any<br>
moment when the action/render block is evaluated.</blockquote><div><br>Well, #handleFiltered: *may* return normally; WAResponseNotification is used to indicate that a RequestHandler wants to *immediately* abort processing and return a response. In practice though, when using RenderLoop, we pretty much always signal a notification.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
As it&#39;s not resumable, the block will be evaluating the ifCurtailed even when<br>
all is perfectly fine.<br>
</blockquote><div><br>The fact that the notification is non-resumeable is not really the
issue. The notification will always be caught by the ServerAdaptor and
that will cause the stack to be unwound, which causes your
#ifCurtailed: to be called. Your code *is* being abnormally terminated
by a request to immediately return a response.<br>
<br>
Try executing this (which uses a resumeable notification) in a workspace, for example:<br>
<br>
[[nil notify: 1] ifCurtailed: [Transcript show: &#39;curtailed&#39;]]<br>    on: Notification do: []<br><br>Filters or request handlers can, of course, intercept the WAResponseNotification and modify the Response as they see fit.<br>
<br>Julian<br></div></div><br>