17 Replies Latest reply on Feb 13, 2010 9:32 AM by Gregory Lafrance

    BIG problem with Flex site

    Marlene

      My site is located at http://www.shopburbank.org  I have tested the site with the Litmus site (which allows me to see screenshots of 14 browsers) and everything is fine. Unfortunately, a number of people are reporting that the site appears to be loading but the information for the individual stores is not showing up in the white window. Initially, it appeared that it was just IE8 but I am now getting reports that this is happening in multiple browsers. Unfortunately, these are people just calling the city of Burbank to complain and don't give any details. I cannot get this problem to reproduce. I talked to my host who also experienced the problem when they tested on their internal browsers but confirmed that other browsers outside their servers everything appeared to be fine. This was created with Flex with a data call to a database. The HTML file is customized with meta tags and a script for google analytics. I don't know what to look at next for problems. I need to find someone who can reproduce the problem and then help me resolve the issuel. Any help would be SO appreciated.

       

      Marlene

        • 1. Re: BIG problem with Flex site
          archemedia Level 4

          What you can do to start, is handle the fault event of your HTTPService or RemoteObject to monitor what's happening:

           


          <mx:RemoteObject fault="handleFault(event)" .../>

           

          ..

           

           

                      public function handleFault(evt:FaultEvent):void

           

                      {

           

                          Alert.show(evt.fault.message);

           

                      }

           

          Dany

          • 2. Re: BIG problem with Flex site
            Marlene Level 1

            I have added a fault event as you suggested (thank you). I am not seeing anything different but would it be true that people who are experiencing a problem will see the error message?

            • 3. Re: BIG problem with Flex site
              Gregory Lafrance Level 6

              That's right. The end users would see the error message if the data service component (HTTPService, etc.) dispatches the fault event when the user launches and navigates the UI.

               

              The challenge is how to turn this into something that will help you. You could display your email address, and ask the user to email you and provide the version of their browser, their OS, and a brief description of the problem. Displaying a phone number might be better, but you might get inundated with calls, and if its a cell phone you might eat up your minutes fast.

               

              Your app is pretty simple, so you could even send a message to the server whenever the user clicks on anything in the app, kind of like tracking their use of the app, but that might not help, because if it is an environment issue (browser config etc) then that likely would not help.

              • 4. Re: BIG problem with Flex site
                archemedia Level 4

                Couldn't you call a server script within the fault handler to send an email back to yourself?

                 

                Dany

                • 5. Re: BIG problem with Flex site
                  yoav@cyteam.com

                  It looks OK for me (using Chrome) ,  so if its ok for some and not ok for others its probably flash-version or other local browser/environment configuration issue.

                  What I would do, as suggested by others is to find someone who's experiencing the problem. Then, regenerate the swf  to a lower player requirement, you could also try to implement the "white box" using a different component (e.g. Panel, or a TitleWindow ) or also change the fonts/color/background  of the box display (as it might be a simple visual issue ..).

                  And obviously check with the "one experiencing the problem" , iterate until resolved.

                   

                  Hope my two cents helps,

                   

                  Yoav

                  • 6. Re: BIG problem with Flex site
                    Marlene Level 1

                    That sounds like fantastic idea. But I am not sure how to write the server script to do this. This is my current fault handler function:

                    public function dataFaultHandler(evt:FaultEvent):void

                     

                                {

                     

                                    Alert.show("We are sorry you are experiencing problems. Please click on Download Flyer tab to see a list of current offers");

                     

                                }

                     

                    I would be so grateful for some help writing this script. We are a little desperate to find a solution for this problem and will to hire a consultant who is familiar with server functionality to help us resolve this.

                    • 7. Re: BIG problem with Flex site
                      archemedia Level 4

                      You should first do a simple alert statement like the one you posted and test with a customer who's having troubles. If the alert doesn't show up, it's useless to write a mail script. If it does, I will provide such a script.

                       

                      It might be a configuration problem too, as the previous contributor mentioned.

                       

                      Dany

                      • 8. Re: BIG problem with Flex site
                        Ansury Level 3

                        Marlene - Is it possible that some users have an OLD version of the swf cached in their browsers?

                         

                        It shouldn't do this but I've had issues in the past.  (If you think this is the problem, add a static-text version number which you increment every time you make a change to the swf. If the user doesn't see the most recent number, something is screwy with caching.)

                         

                         

                        If they're having connectivity problems that server call in the fault handler may just fail as well.

                         

                        To the OP: Do you do any sort of load-balancing on the back end?  Are there multiple servers that the clients get redirected to via some load balancing mechanism?  What type of back end is supporting this site?  (What type of application server?)  If there's multiple servers perhaps there's an outdated version of the swf still on one of them?

                         

                        Information in the "white window" does not show, meaning the dialog when you click on a row?  This is interesting because the only new information it seems to show me is a phone number, and it's fast, so I'd imagine that this information is already in memory when it displays in the original list...

                        • 9. Re: BIG problem with Flex site
                          Ansury Level 3

                          yoav@cyteam.com wrote:

                           

                          Then, regenerate the swf  to a lower player requirement, you could also try to implement the "white box" using a different component (e.g. Panel, or a TitleWindow ) or also change the fonts/color/background  of the box display (as it might be a simple visual issue ..).

                           

                           

                          Ahh yes, the "white text on white background problem" once you start messing around with css a little too much...

                           

                          Flash Player version, well maybe, but that shouldn't be the problem and if it is Adobe has some explaining to do.

                          • 10. Re: BIG problem with Flex site
                            Marlene Level 1

                            So we found a user who is still experiencing the blank window problem BUT she verified that she is able to see the error that I recently wrote into the fault handler. So can we go ahead and come up with an email script like you suggested that sends some information to me so I can figure out what the problem is. We are more than willing to hire you on as a consultant to help us with this problem. Your expertise is valuable to us. If that is a possibility, let us know how to proceed.

                             

                            Thank you

                            Marlene

                            • 11. Re: BIG problem with Flex site
                              archemedia Level 4

                              It's really quite simple:

                               

                              I suppose your server supports php?

                               

                              On your server, create a php file named 'mailError.php'

                              In this file, paste following code:

                               

                              <?php
                                  $fault = $_GET['faultMessage'];
                                  mail("yourEmailAddress", "error message", $fault);
                                  echo $fault;
                              ?>

                               

                              That's all for the server side!

                               

                              Then:

                               

                              In your flex application, add an additional httpService object:

                               

                              <mx:HTTPService id="mailReporter" url="http://yourDomain.com/mailError.php" method="GET"
                                      result="handleMailResult(event)" fault="handleMailFault(event)"/> //these handlers are optional since the php script will send a mail after all.

                               

                              To finish, in your fault function from your httpService, write:

                               

                              private function handleFault(evt:FaultEvent):void

                              {
                                    mailReporter.send({faultMessage: evt.fault.faultDetail});
                              }

                               

                              Let us know what the error is!

                               

                              Dany

                              • 12. Re: BIG problem with Flex site
                                Marlene Level 1

                                My noobieness is showing but here are a couple of questions?

                                Don't I need a handleMailResult function?

                                Also the faultHandler should be named handleMailFault right?

                                • 13. Re: BIG problem with Flex site
                                  Ansury Level 3

                                  Marlene wrote:

                                   

                                  My noobieness is showing but here are a couple of questions?

                                  Don't I need a handleMailResult function?

                                  Also the faultHandler should be named handleMailFault right?

                                   

                                  Edit: scratch that - it looks like he's providing you with a faultHandler for the call that is failing, which will trigger the email, sending the error via mail.  The mail request would still have two separate handlers.

                                   

                                  So you would add faultHandler (in addition to the result handler you must already have, for the service call which is failing), and optionally two additional handlers for the mailReporter service where you may want to somehow notify the user of success/failure reporting the problem.

                                  • 14. Re: BIG problem with Flex site
                                    Marlene Level 1

                                    OK now I am really confused. Can somebody clarify the correct code for the HTTPService call and the result and fault functions.

                                    • 15. Re: BIG problem with Flex site
                                      nIvelyx

                                      Ansury has it correct I believe:

                                       

                                      <mx:HTTPService id="mailReporter" url="http://www.shopburbank.org/mailError.php" method="GET" /> // optionally add handlers.

                                       

                                      Place this in your current fault handler:
                                            mailReporter.send({faultMessage: evt.fault.faultDetail});

                                       

                                       

                                      So to repeat and be thorough:

                                       

                                      1. Add the new HTTPService that was mentioned above

                                      2. Add mailReporter.send({faultMessage: evt.fault.faultDetail});  to your current fault handler (this is where you have your alert.show('message'), that you mentioned earlier)

                                      3. Make sure that you create that mailError.php file and place it on your server.

                                       

                                      To test this, you could fire off an event in your init method (the first method that you call) like so...

                                       

                                      public function init():void {

                                           mailReporter.send({faultMessage: 'this is a test from flex'}); // you don't want to fire off a fault event here, because ideally no fault would have been created

                                      }

                                       

                                       

                                      Edit:

                                       

                                      Also, the reason why he mentioned this:

                                       

                                      private function handleFault(evt:FaultEvent):void

                                       

                                      is because the fault message will correspond to the name of the string being called in the FaultEvent, so for example, if you fault handler looked like:

                                       

                                      private function my_https_service_number_one(e:FaultEvent):void,

                                       

                                      then the fault message handler would read e.fault.faultDetail  instead of evt.fault.faultDetail

                                       

                                      ...

                                       

                                       

                                      Hope this helps

                                      • 16. Re: BIG problem with Flex site
                                        Gregory Lafrance Level 6

                                        This simple yet end-to-end example should clear things up.

                                         

                                        -------- faultEmail.php -------

                                        <?php

                                          $email = $_GET['email'];

                                          $info = $_GET['info'];

                                         

                                          mail($email, "My Fancy Email Subject Line", $info);

                                          echo "OK";

                                        ?>

                                         

                                         

                                        <?xml version="1.0" encoding="utf-8"?>
                                        <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
                                          <mx:Script>
                                            <![CDATA[
                                              import mx.rpc.events.ResultEvent;
                                              import mx.controls.Alert;
                                              import mx.rpc.events.FaultEvent;
                                             
                                              private function faultFunc(evt:FaultEvent):void{
                                                mx.controls.Alert.show("An error has occurred. We apologize the for inconvenience. An email has automatically sent to our support team.", "Error Notification");
                                                var params:Object = new Object();
                                                trace(evt.fault);
                                                params.info = evt.fault + "\n\n\n" + "Whatever else I want to send to server.";
                                                params.email = txt.text;
                                                faultEmailSvc.send(params);
                                              }
                                             
                                              private function emailResult(evt:ResultEvent):void{
                                                // Getting to this point does not necessarily mean email was sent successfully.
                                                mx.controls.Alert.show("Message sent successfully.");
                                              }

                                              private function emailFault(evt:FaultEvent):void{
                                                mx.controls.Alert.show("Error sending message.");
                                              }
                                            ]]>
                                          </mx:Script>
                                          <mx:HTTPService id="dataSvc" url="dataFile.xml" fault="faultFunc(event)"/>
                                          <mx:HTTPService id="faultEmailSvc" url="http://www.yoursite.com/faultEmail.php"
                                            result="emailResult(event)" fault="emailFault(event)"/>
                                          <mx:HBox>
                                            <mx:Label text="Your email:"/>
                                            <mx:TextInput id="txt"/>
                                          </mx:HBox>
                                          <mx:Button label="Cause Fault and Receive Email"
                                            click="dataSvc.send();" enabled="{txt.text!=''}"/>
                                        </mx:Application>


                                        If this post helps, please mark it as such.


                                        Greg Lafrance - Flex 2 and 3 ACE certified

                                        www.ChikaraDev.com

                                        Flex / AIR Development, Training, and Support Services

                                        • 17. Re: BIG problem with Flex site
                                          Gregory Lafrance Level 6

                                          I tried changing all kinds of options in Internet Explorer 8 and still could not reproduce the issue.

                                           

                                          You might want an HTTPService component update something on the server everytime someone goes to your site, and also record when the problem occurs. That way you can see how often it occurs, and mention that to the client, like it only happens to one out of every 100 visitors.

                                           

                                          That assumes of course that your fault email system in fact catches the issues.