<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2657.73">
<TITLE>Working with proxies</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hello Avi,</FONT>
</P>

<P><FONT SIZE=2>While using Opentalk with Seaside on VW I came across</FONT>
<BR><FONT SIZE=2>a difficulty with walkbacks. The symptom is that no html</FONT>
<BR><FONT SIZE=2>output is sent back to the browser when a exception occurs</FONT>
<BR><FONT SIZE=2>in the Seaside application. The reason is that there is</FONT>
<BR><FONT SIZE=2>an exception during the rendering of the walkback, when</FONT>
<BR><FONT SIZE=2>a proxy is the receiver in one of the stack frames.</FONT>
</P>

<P><FONT SIZE=2>I believe this issue with proxies was already adressed</FONT>
<BR><FONT SIZE=2>a few weeks ago, however the check for being a proxy does</FONT>
<BR><FONT SIZE=2>not port to VisualWorks.</FONT>
</P>

<P><FONT SIZE=2>In WAWalkback &gt; renderStackFrame:on: the current code reads</FONT>
</P>

<P><FONT SIZE=2>((receiver class instSize &gt; 0) and:</FONT>
<BR><FONT SIZE=2>[receiver class allSuperclasses includes: Object]) ifTrue:</FONT>
</P>

<P><FONT SIZE=2>I suggest to refactor it by something like</FONT>
</P>

<P><FONT SIZE=2>((SeasidePlatformSupport isNotProxy: receiver) and:</FONT>
<BR><FONT SIZE=2>[receiver class instSize &gt; 0]) ifTrue:</FONT>
</P>

<P><FONT SIZE=2>This allows to check for a proxy before sending #class</FONT>
<BR><FONT SIZE=2>and has the benefit of making the code more 'intention revealing'.</FONT>
</P>

<P><FONT SIZE=2>I am also suggesting to rewrite renderObject:labelled:on:</FONT>
<BR><FONT SIZE=2>with something like this.</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>| objectString |</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>[objectString := (SeasidePlatformSupport isNotProxy: anObject)</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>ifTrue: </FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>[anObject printStringLimitedTo: 100]</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>ifFalse: </FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>[anObject printString]</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>] on: Error</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>do: </FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>[:err | </FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>objectString := 'error in printStringLimitedTo:'.</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>html attributeAt: 'style' put: 'color: red'].</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>html tableRowWithLabel: aString column: objectString.</FONT>
</P>

<P><FONT SIZE=2>If you would update the Seaside code base, that would make</FONT>
<BR><FONT SIZE=2>the port to VW much cleaner.</FONT>
</P>

<P><FONT SIZE=2>Thanks in advance,</FONT>
<BR><FONT SIZE=2>Michel.</FONT>
</P>

</BODY>
</HTML>