AJAX redirect problem

Oct 11, 2012 at 9:04 AM
Edited Oct 11, 2012 at 9:05 AM

Hi.

1) From the UI and invoke a repository action that lists a number of entities.

2) I click on entity A to load it (Object View)

3) I now invoke another repository action that returns void, and emits out put with Container.InformUser().

4) The feedback message is briefly shown on the screen, but then about half a second later

5) The view reverts back to the object view of entity A, with no feedback message showing.

 

In stead of returning void on my second repository action method, I created a new class ActionComplete, and returned that, but the same behavior.

 

	[NotPersisted]
	[Immutable]
	public class ActionComplete
	{
		public string Result { get; set; }
	}

 

Behavior was the same before and after the upgrade.

Coordinator
Oct 11, 2012 at 9:18 AM

First, please just confirm that you are seeing this behaviour with the generic NO MVC UI  i.e. with zero customizations or added Javascript.  (You will recall from previous discussions my recommendation that you always have an unmodified NO MVC run project alongside your own customised one, to check this sort of issue).

If you confirm that, I will raise this as an Issue ticket for investigation.

Then, please also clarify:, when you say 'I created a new class ActionComplete, and returned that, but the same behavior.'  -  do you mean that you ended up with a view of the ActionComplete, but no message, or that you ended up back at a view of entity A?

Finally, is the 're-direct' only in evidence when you are doing an InformUser() -  or are there other circumstances where it is happening?

Oct 11, 2012 at 10:13 PM

Hi Richard.

First, please just confirm that you are seeing this behaviour with the generic NO MVC UI  i.e. with zero customizations or added Javascript.  (You will recall from previous discussions my recommendation that you always have an unmodified NO MVC run project alongside your own customised one, to check this sort of issue).

Yes, I have a raw NO MVC runner project to test against. Behavior is the same on that.

Then, please also clarify:, when you say 'I created a new class ActionComplete, and returned that, but the same behavior.'  -  do you mean that you ended up with a view of the ActionComplete, but no message, or that you ended up back at a view of entity A?

It ended up back at a view of entity A.

When it shows the user message, for about 500 ms, it does also correctly display a view of the instance of my ActionComplete that I returned, but then bounces back to entity A.

Finally, is the 're-direct' only in evidence when you are doing an InformUser() -  or are there other circumstances where it is happening?

Well, I just removed the calls to Container.InformUser(), and it is still happening, but not sure of other scenarios.  

A bit more information.

When I navigate to a view of entity A, and then hit F5 on the browser to refresh the page, it seems to first load System/Index, and then, a moment later it loads the view of entity A that I was on. The problematic behavior looks very similar to this correct behavior.


Coordinator
Oct 12, 2012 at 7:48 AM

Thanks for the clarifications.  But if you're saying that the InformUser() call is not significant, then we need to get a better handle on the scope of the problem. You are presumably not getting this 'bounce back' every time you are viewing an object (A) and then invoke an action that returns another object (B), are you?

Given that we cannot recall seeing this particular problem before, I'm concerned about being able to reproduce it.  Ideally, if you can create a minimal example project (e.g. 2 small classes & simple repositories ) and a scenario that shows it, we can reproduce and diagnose.

Also, just for background, please let us know which browser (& version) you are using  -  and do you get the same behaviour on any other browser?  

Oct 12, 2012 at 8:30 AM

I am using the latest version of FireFox. But it does the same in Chrome.

However, I think I have found the culprit. The repository action in question took a FileAttachment parameter.

If I change that to a string, for example, the problem goes away.

Even if the method body is empty, the moment I have a FileAttachment parameter, it behaves like that.

Coordinator
Oct 12, 2012 at 8:39 AM

"However, I think I have found the culprit. The repository action in question took a FileAttachment parameter."

Good.

If you can put together the minimum project (one class now, maybe and one repository) that demonstrates the problem and attach it (or email to me), with the user steps to reproduce, we'll add a ticket and investigate the cause.