Chrome and Safari did NOT find the Aida Context

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Chrome and Safari did NOT find the Aida Context

BrunoBB

Hi,

 

I do NOT fix the problema, but i found why this is happening.

 

The problem is the method: WebApplication>>findCreateOrSerializeContextFor:

 

findCreateOrSerializeContextFor: aRequest

                "and set the current context and view"

                "for posts and ajax request the context id must always be present in request!"

                "Serialize execution if some other request is already executing"

                | ctx |

 

                ctx := self findContextFor: aRequest.

                (ctx isNil and: [aRequest isPost or: [aRequest isAjaxRequest]]) ifTrue: [^nil]. "this should not happen!"

                ctx isNil ifTrue: [ctx := self findContextSameViewFor: aRequest]. "temporary"

                ctx isNil ifTrue:

                                [ctx := (WebContextFirst newOn: self) view: aRequest view.

                                self addContext: ctx].

                ctx isBusy ifTrue: [ctx serialize: aRequest]. "Dolphin fix"  "context is busy, serialize execution"

                ctx request: aRequest.

                aRequest context: ctx.

                ^ctx

In Opera and Mozilla after the popup windows is closed this method is executed and:

(ctx isNil and: [aRequest isPost or: [aRequest isAjaxRequest]]) answer FALSE. (which is OK)

 

But under Chrome and Safari

(ctx isNil and: [aRequest isPost or: [aRequest isAjaxRequest]]) answer True. According with comments  "this should not happen!"

 

Now I going to find what is causing this difference.

 

Regards,

Bruno

 

 


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

Janko Mivšek
Hi Bruno!

Is it possible that order of two Ajax requests is in question? Namelly,
for many actions two Ajax requests are sent and it is possible that they
don't come in the order as they are sent. For closing a popup you have
one request for close and another for update. It could be that popup
context is "closed" before the other request come and that's why this
error occurs.

Best regards
Janko

On 05. 05. 2010 21:33, Smalltalk wrote:

> Hi,
>
>  
>
> I do NOT fix the problema, but i found why this is happening.
>
>  
>
> The problem is the method: WebApplication>>findCreateOrSerializeContextFor:
>
>  
>
> findCreateOrSerializeContextFor: aRequest
>
>                 "and set the current context and view"
>
>                 "for posts and ajax request the context id must always
> be present in request!"
>
>                 "Serialize execution if some other request is already
> executing"
>
>                 | ctx |
>
>  
>
>                 ctx := self findContextFor: aRequest.
>
>                 (ctx isNil and: [aRequest isPost or: [aRequest
> isAjaxRequest]]) ifTrue: [^nil]. "this should not happen!"
>
>                 ctx isNil ifTrue: [ctx := self findContextSameViewFor:
> aRequest]. "temporary"
>
>                 ctx isNil ifTrue:
>
>                                 [ctx := (WebContextFirst newOn: self)
> view: aRequest view.
>
>                                 self addContext: ctx].
>
>                 ctx isBusy ifTrue: [ctx serialize: aRequest]. "Dolphin
> fix"  "context is busy, serialize execution"
>
>                 ctx request: aRequest.
>
>                 aRequest context: ctx.
>
>                 ^ctx
>
> In Opera and Mozilla after the popup windows is closed this method is
> executed and:
>
> (ctx isNil and: [aRequest isPost or: [aRequest isAjaxRequest]]) answer
> FALSE. (which is OK)
>
>  
>
> But under Chrome and Safari
>
> (ctx isNil and: [aRequest isPost or: [aRequest isAjaxRequest]]) answer
> True. According with comments  "this should not happen!"
>
>  
>
> Now I going to find what is causing this difference.
>
>  
>
> Regards,
>
> Bruno
>
>  
>
>  
>
>
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

BrunoBB
Janko,

Yes. At the first time it seems that is the case.
But I'm not 100% sure. I will continue the research.

Regards,
Bruno

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de Janko Mivšek
Enviado el: Thursday, May 06, 2010 3:46 AM
Para: AIDA/Web general discussion list
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Hi Bruno!

Is it possible that order of two Ajax requests is in question? Namelly,
for many actions two Ajax requests are sent and it is possible that they
don't come in the order as they are sent. For closing a popup you have
one request for close and another for update. It could be that popup
context is "closed" before the other request come and that's why this
error occurs.

Best regards
Janko

On 05. 05. 2010 21:33, Smalltalk wrote:

> Hi,
>
>  
>
> I do NOT fix the problema, but i found why this is happening.
>
>  
>
> The problem is the method: WebApplication>>findCreateOrSerializeContextFor:
>
>  
>
> findCreateOrSerializeContextFor: aRequest
>
>                 "and set the current context and view"
>
>                 "for posts and ajax request the context id must always
> be present in request!"
>
>                 "Serialize execution if some other request is already
> executing"
>
>                 | ctx |
>
>  
>
>                 ctx := self findContextFor: aRequest.
>
>                 (ctx isNil and: [aRequest isPost or: [aRequest
> isAjaxRequest]]) ifTrue: [^nil]. "this should not happen!"
>
>                 ctx isNil ifTrue: [ctx := self findContextSameViewFor:
> aRequest]. "temporary"
>
>                 ctx isNil ifTrue:
>
>                                 [ctx := (WebContextFirst newOn: self)
> view: aRequest view.
>
>                                 self addContext: ctx].
>
>                 ctx isBusy ifTrue: [ctx serialize: aRequest]. "Dolphin
> fix"  "context is busy, serialize execution"
>
>                 ctx request: aRequest.
>
>                 aRequest context: ctx.
>
>                 ^ctx
>
> In Opera and Mozilla after the popup windows is closed this method is
> executed and:
>
> (ctx isNil and: [aRequest isPost or: [aRequest isAjaxRequest]]) answer
> FALSE. (which is OK)
>
>  
>
> But under Chrome and Safari
>
> (ctx isNil and: [aRequest isPost or: [aRequest isAjaxRequest]]) answer
> True. According with comments  "this should not happen!"
>
>  
>
> Now I going to find what is causing this difference.
>
>  
>
> Regards,
>
> Bruno
>
>  
>
>  
>
>
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

BrunoBB
Janko,

I have inserted a #halt in: WebApplication>>printWebPageFor:

In Mozilla (works ok) after push a button that open a popup, the halt order:
1. CTX 82900 (first context)
2. CTX 6394 (popup context)
3. CTX nil - but the context is obtained with: #findContextSameViewFor:

In Chrome (bug) after push a button that open a popup, the halt order:
1. CTX 16486 (first context)
2. CTX 65800 (popup context)
3. CTX nil - here at #findCreateOrSerializeContextFor:, [aRequest isAjaxRequest] answer true and the context is NIL.

I think the order of the Ajax request is ok.

Still searching...

Regards,
Bruno





_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

Herbert König
In reply to this post by Janko Mivšek
Hi Janko, Bruno

JM> Is it possible that order of two Ajax requests is in question? Namelly,
JM> for many actions two Ajax requests are sent and it is possible that they
JM> don't come in the order as they are sent. For closing a popup you have
JM> one request for close and another for update. It could be that popup
JM> context is "closed" before the other request come and that's why this
JM> error occurs.

in the "onClickDo:andUpdateMany" enhancement Alex made sure that this
cannot happen. Each Ajax request is created in the "onComplete" of the
previous request. Nonetheless I'm also experiencing problems (in FF,
IE and Opera) that the requests are handled in the wrong sequence.

My hypothesis about that is, that each request is a separate Squeak
process and AFAIK a new squeak process preemts old processes with the
same priority. But then this should only happen in Squeak.

Whatever happens: an inspector on the model shows that all aspects of
the model are updated, all the methods that update the HTML elements
get called but the Browser only shows part of the updates.



Cheers,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

BrunoBB
In reply to this post by BrunoBB
Janko,

I forgot to mention that the popup is opened OK in Chrome and Safari.
Then is closed Ok, but the last step fail (return to the page where the
button was pressed).

Regards,
Bruno


-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de
Smalltalk
Enviado el: Thursday, May 06, 2010 10:44 AM
Para: 'AIDA/Web general discussion list'
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Janko,

I have inserted a #halt in: WebApplication>>printWebPageFor:

In Mozilla (works ok) after push a button that open a popup, the halt order:
1. CTX 82900 (first context)
2. CTX 6394 (popup context)
3. CTX nil - but the context is obtained with: #findContextSameViewFor:

In Chrome (bug) after push a button that open a popup, the halt order:
1. CTX 16486 (first context)
2. CTX 65800 (popup context)
3. CTX nil - here at #findCreateOrSerializeContextFor:, [aRequest
isAjaxRequest] answer true and the context is NIL.

I think the order of the Ajax request is ok.

Still searching...

Regards,
Bruno





_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

BrunoBB
In reply to this post by Herbert König
Hi Herbert,

I'm using Dolphin Smalltalk.

But you are right, the Chrome and Safari fail to return to updated original
page but the operation is done.
If I refresh the page after the context error --> everything is OK, the
change in the model is done.

Regards,
Bruno

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de
Herbert König
Enviado el: Thursday, May 06, 2010 10:48 AM
Para: AIDA/Web general discussion list
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Hi Janko, Bruno

JM> Is it possible that order of two Ajax requests is in question? Namelly,
JM> for many actions two Ajax requests are sent and it is possible that they
JM> don't come in the order as they are sent. For closing a popup you have
JM> one request for close and another for update. It could be that popup
JM> context is "closed" before the other request come and that's why this
JM> error occurs.

in the "onClickDo:andUpdateMany" enhancement Alex made sure that this
cannot happen. Each Ajax request is created in the "onComplete" of the
previous request. Nonetheless I'm also experiencing problems (in FF,
IE and Opera) that the requests are handled in the wrong sequence.

My hypothesis about that is, that each request is a separate Squeak
process and AFAIK a new squeak process preemts old processes with the
same priority. But then this should only happen in Squeak.

Whatever happens: an inspector on the model shows that all aspects of
the model are updated, all the methods that update the HTML elements
get called but the Browser only shows part of the updates.



Cheers,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

BrunoBB
Hi,

I do not know if I have the same problem as Herbert, but in my case the
problem is:
aRequest isAjaxRequest.

I inserted a #halt and with an inspector i delete the key <X-REQUESTED-WITH>
of [aRequest headers fields] then Chrome behave as expected.
(Is in the last #halt, the #halt that return NIL as context but after that
is obtained with #findContextSameViewFor:)

But I do not know why in the case of Chrome and Safari the headers of the
request has this key but in FF and Opera NOT.

Still searching !

Regards,
Bruno

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de
Smalltalk
Enviado el: Thursday, May 06, 2010 10:54 AM
Para: 'AIDA/Web general discussion list'
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Hi Herbert,

I'm using Dolphin Smalltalk.

But you are right, the Chrome and Safari fail to return to updated original
page but the operation is done.
If I refresh the page after the context error --> everything is OK, the
change in the model is done.

Regards,
Bruno

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de
Herbert König
Enviado el: Thursday, May 06, 2010 10:48 AM
Para: AIDA/Web general discussion list
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Hi Janko, Bruno

JM> Is it possible that order of two Ajax requests is in question? Namelly,
JM> for many actions two Ajax requests are sent and it is possible that they
JM> don't come in the order as they are sent. For closing a popup you have
JM> one request for close and another for update. It could be that popup
JM> context is "closed" before the other request come and that's why this
JM> error occurs.

in the "onClickDo:andUpdateMany" enhancement Alex made sure that this
cannot happen. Each Ajax request is created in the "onComplete" of the
previous request. Nonetheless I'm also experiencing problems (in FF,
IE and Opera) that the requests are handled in the wrong sequence.

My hypothesis about that is, that each request is a separate Squeak
process and AFAIK a new squeak process preemts old processes with the
same priority. But then this should only happen in Squeak.

Whatever happens: an inspector on the model shows that all aspects of
the model are updated, all the methods that update the HTML elements
get called but the Browser only shows part of the updates.



Cheers,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

BrunoBB
Hi,

I did not solve the problem yet, but I have done a very ugly workaround:
printWebPageFor: aRequest
| ctx |
ctx := self findCreateOrSerializeContextFor: aRequest.
ctx  isNil
ifTrue: [aRequest headers fields removeKey: 'X-REQUESTED-WITH'.
        ctx := self findCreateOrSerializeContextFor: aRequest.].

I know it is very ugly but is just for now, I'm still searching.

Regards,
Bruno

PS: anyway is still wrong. Because I execute the command then the page is
updated with the new value.
But if I click the button to execute the command again when the popup
windows is opened the main page returns to it's previous state.

For example I click "Change Name" button to change object name.
The popup arise I type 'First Name' and the page is updated correctly.
But if I click the command again when popup arise then the main page shows
the name previous to 'First Name'.


-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de
Smalltalk
Enviado el: Thursday, May 06, 2010 4:56 PM
Para: 'AIDA/Web general discussion list'
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Hi,

I do not know if I have the same problem as Herbert, but in my case the
problem is:
aRequest isAjaxRequest.

I inserted a #halt and with an inspector i delete the key <X-REQUESTED-WITH>
of [aRequest headers fields] then Chrome behave as expected.
(Is in the last #halt, the #halt that return NIL as context but after that
is obtained with #findContextSameViewFor:)

But I do not know why in the case of Chrome and Safari the headers of the
request has this key but in FF and Opera NOT.

Still searching !

Regards,
Bruno

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de
Smalltalk
Enviado el: Thursday, May 06, 2010 10:54 AM
Para: 'AIDA/Web general discussion list'
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Hi Herbert,

I'm using Dolphin Smalltalk.

But you are right, the Chrome and Safari fail to return to updated original
page but the operation is done.
If I refresh the page after the context error --> everything is OK, the
change in the model is done.

Regards,
Bruno

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de
Herbert König
Enviado el: Thursday, May 06, 2010 10:48 AM
Para: AIDA/Web general discussion list
Asunto: Re: [aida] Chrome and Safari did NOT find the Aida Context

Hi Janko, Bruno

JM> Is it possible that order of two Ajax requests is in question? Namelly,
JM> for many actions two Ajax requests are sent and it is possible that they
JM> don't come in the order as they are sent. For closing a popup you have
JM> one request for close and another for update. It could be that popup
JM> context is "closed" before the other request come and that's why this
JM> error occurs.

in the "onClickDo:andUpdateMany" enhancement Alex made sure that this
cannot happen. Each Ajax request is created in the "onComplete" of the
previous request. Nonetheless I'm also experiencing problems (in FF,
IE and Opera) that the requests are handled in the wrong sequence.

My hypothesis about that is, that each request is a separate Squeak
process and AFAIK a new squeak process preemts old processes with the
same priority. But then this should only happen in Squeak.

Whatever happens: an inspector on the model shows that all aspects of
the model are updated, all the methods that update the HTML elements
get called but the Browser only shows part of the updates.



Cheers,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

Herbert König
Hi Bruno,

S> I did not solve the problem yet, but I have done a very ugly workaround:
S> printWebPageFor: aRequest
S> | ctx |
S> ctx := self findCreateOrSerializeContextFor: aRequest.
S> ctx  isNil
S> ifTrue: [aRequest headers fields removeKey: 'X-REQUESTED-WITH'.
S> ctx := self findCreateOrSerializeContextFor: aRequest.].

tonight or at the weekend I'll check if my problems are related.



Cheers,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Chrome and Safari did NOT find the Aida Context

Herbert König
In reply to this post by BrunoBB
Hi,
S> I did not solve the problem yet, but I have done a very ugly workaround:
S> printWebPageFor: aRequest
S> | ctx |
S> ctx := self findCreateOrSerializeContextFor: aRequest.
S> ctx  isNil
S> ifTrue: [aRequest headers fields removeKey: 'X-REQUESTED-WITH'.

now i checked, my problem is different because in my case ctx is never
nil and all requests are executed. Actually they come in in the
sequence they are supposed to. Have to try Chrome and Safari.

Anyway I got my problem worked around by just changing the sequence in
which components are updated.

Completely mysterious: Imagine one method updates the model, then
three components of the web page are ajax updated, each reflecting the
same aspect of a model in a different way. One of them (WebGrid)
doesn't reflect the change if it's updated first.

Put that on my todo list, I spent too much time on this already.

Cheers,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida