Steve,

I tried it again (sequentially) and did crash.  One thing I noticed is that
it does not crash when in landscape mode.  That tells me that it may not be
cookie related.

Chris.

On Feb 7, 2008 9:43 PM, Chris Van Dusen <[EMAIL PROTECTED]> wrote:

> Steve,
>
> Ah.  That may be the difference.  I didn't click sequential down the
> list (which is telling).
> I'll give it a try when I get to work tomorrow (where the iPhone is),
> and let you know.
>
> Chris.
>
> On Feb 7, 2008, at 8:34 PM, Steve Finkelstein wrote:
>
> >
> > Hi Chris,
> >
> > Thanks for the reply.
> >
> > Unfortunately rebooting the darn thing was my first instinct upon
> > bumping into this annoying bug. I took the initiative to find 5
> > colleagues with an iPhone and one colleague with an iTouch -- I was
> > able to replicate the crashing of Safari on all 6 devices.
> >
> > I certainly wish I had the technical details worked out, and could
> > blame it on my cookie code, but I really can't. It might be
> > coincidence that after I added cookie code, that I was able to
> > reproduce this crash.
> >
> > I setup a test page here to further debug, and my browser doesn't
> > crash here: http://catalyst.httpd.org/iphone.html
> >
> > However the URL I provided below is still indeed very consistent for
> > crashing. You just need to sequentially click the names starting from
> > the first name down to about the 6th or 7th and it'll pop an alert
> > with document.cookie, then crash.
> >
> > Tomorrow I will rewrite the cookie handlers and see if that fixes it.
> > I just really hate abandoning the problem because it would be nice to
> > know what is consistently crashing mobile safari and if it's possible
> > to avoid it in future production.
> >
> > /sf
> >
> > On 2/7/08, Chris Van Dusen <[EMAIL PROTECTED]> wrote:
> >>
> >> This may sound crazy, but have you tried resetting the iPhone(s)?
> >>
> >> I had just deployed some code for the iPhone when 1.1.3 came out.  I
> >> updated the phone, but when I went to test the app in production,
> >> images were not displaying, and a search was not working.  The QA
> >> guys updated the iPhone and iPod Touch that they use and didn't have
> >> a problem.  After resetting, mine worked fine.
> >>
> >> Regarding your post about clearing cookies:  I've gotten to the point
> >> where I would click 'Clear' twice before retesting.  I was talking to
> >> one of the aforementioned QA guys and he said that he clears cookies,
> >> goes back to Safari opens a new window and removes the one he was
> >> testing with before.   Now, I do that too...
> >>
> >> hth,
> >> Chris.
> >>
> >>
> >> On Feb 7, 2008, at 4:12 PM, Steve Finkelstein wrote:
> >>
> >>>
> >>> Chris,
> >>>
> >>> that's so darn odd. I'm able to replicate it all the time as soon
> >>> as I
> >>> hit the 'Leslie' patient. If I go straight down the list
> >>> sequentially
> >>> it consistently crashes on my iPhone. It does on a co-workers as
> >>> well.
> >>> I don't even know where to begin to start debugging.
> >>>
> >>> /sf
> >>>
> >>> On 2/7/08, cvd <[EMAIL PROTECTED]> wrote:
> >>>> I was able to click all patients with no crash on the iPhone.  I'm
> >>>> running
> >>>> 1.1.3.
> >>>>
> >>>> Chris.
> >>>>
> >>>>
> >>>> On Feb 7, 2008 1:47 PM, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> >>>>
> >>>>>
> >>>>>
> >>>>> If anyone wishes to try to replicate the crash, you can visit a
> >>>>> demo
> >>>>> of the site on http://iphone2.limemedical.com.
> >>>>>
> >>>>> If you click on Patient List via the landing page, click on the
> >>>>> first
> >>>>> 7+ patients (obviously they aren't real people)
> >>>>>
> >>>>> Your browser should and will crash (on the iPhone, won't on the
> >>>>> desktop)
> >>>>>
> >>>>> There's nothing odd about my code that I can find. I'm having an
> >>>>> extremely difficult time finding what's the cause of it because of
> >>>>> lack of debugging tools on the iPhone.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> On 2/6/08, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> >>>>>> Hey folks,
> >>>>>>
> >>>>>> I've been able to replicate a consistent crash with Mobile Safari
> >>>>>> using 1.1.3 firmware. I'm using the cookie class written by David
> >>>>>> Flanagan in his highly accredited JavaScript: The Definitive
> >>>>>> Guide,
> >>>>>> code can be found here:
> >>>>>>
> >>>>>>
> >>>> http://www.davidflanagan.com/javascript5/display.php?n=19-2&f=19/
> >>>> Cookie.js
> >>>>>>
> >>>>>> I believe the code I've appended at the bottom of this email
> >>>>>> is the
> >>>>>> culprit. I basically keep track of visited IDs of an <li>
> >>>>>> element in a
> >>>>>> cookie.  In a nutshell for those who don't feel like reading the
> >>>>>> code,
> >>>>>> I create a cookie and set its expiration to 24 hours. In it, I
> >>>>>> have a
> >>>>>> cookie named visited_data with a value of something like
> >>>>>>
> >>>>>> visited_data=visited:1|2|3|4
> >>>>>>
> >>>>>> where 1,2,3,4 are the visited IDs.  I have code which can
> >>>>>> arbitrarily
> >>>>>> remove ids and add ids. However, on the iPhone .. and iPhone only
> >>>>>> (cannot replicate on Safari3/Webkit).. if I click enough <li>
> >>>>>> elements, about 6+, it crashes the browser.
> >>>>>>
> >>>>>> Does anyone have any idea what could be causing it? Is the
> >>>>>> value of
> >>>>>> the cookie data limited in an iPhone? Is there a more elegant
> >>>>>> approach
> >>>>>> to my solution for storing visited status on multiple
> >>>>>> elements, say
> >>>>>> 100+ ?
> >>>>>>
> >>>>>> Using binary bitmasks has crossed my mind.. but I'm quite
> >>>>>> reluctant at
> >>>>>> the moment in that approach because of readability by other
> >>>>>> developers.
> >>>>>>
> >>>>>> Thanks all.
> >>>>>>
> >>>>>> /sf
> >>>>>>
> >>>>>> code:
> >>>>>>
> >>>>>> function _check_status(obj) {
> >>>>>>
> >>>>>>         var evt = window.event;
> >>>>>>         var el  = evt.srcElement;
> >>>>>>
> >>>>>>         if (el.tagName == "SELECT") return;
> >>>>>>
> >>>>>>         var pid = el.lastChild.id || el.parentNode.lastChild.id;
> >>>>>>
> >>>>>>         // Check if patient has been visited
> >>>>>>         var cookie = new Cookie("visited_data");
> >>>>>>
> >>>>>>         // Check if patient has been visited.
> >>>>>>         if(cookie.visited) {
> >>>>>>                 // check if particular id has been visited.
> >>>>>>
> >>>>>>                         if(!cookie.check(pid)) {
> >>>>>>                                 cookie.visited += "|" + pid;
> >>>>>>                                 cookie.store(1);
> >>>>>>                                 obj.className += " visited";
> >>>>>>
> >>>>>>                         } else {
> >>>>>>                                 var values = cookie.visited.split
> >>>>>> ("|");
> >>>>>>                 delete cookie.visited;
> >>>>>>                                 cookie.visited = '';
> >>>>>>
> >>>>>>                                 for(var i=0; i < values.length; i
> >>>>>> ++) {
> >>>>>>                         if (values[i] == pid)
> >>>>>>                         continue;
> >>>>>>                     else cookie.visited += "|" + values[i] ;
> >>>>>>                 }
> >>>>>>                                 cookie.visited =
> >>>> cookie.visited.substring(1);
> >>>>>>
> >>>>>>                                 cookie.store(1);
> >>>>>>                                 obj.className = "patients";
> >>>>>>                         }
> >>>>>>
> >>>>>>          } else {
> >>>>>>                         cookie.visited = pid;
> >>>>>>                         cookie.store(1);
> >>>>>>                         // User has NOT been visited, enable
> >>>>>> their
> >>>> visited status.
> >>>>>>                         obj.className += " visited";
> >>>>>>          }
> >>>>>>
> >>>>>> }
> >>>>>>
> >>>>>>>
> >>>>>
> >>>>
> >>>
> >>>>
> >>
> >>
> >>>
> >>
> >
> > > >
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to