Mission Manager Community

Mission Manager => Feature Requests and Issues => Topic started by: M.Holmes on January 05, 2013, 06:00:49 PM

Title: Offline- php files don't seem to download
Post by: M.Holmes on January 05, 2013, 06:00:49 PM
Messing around with MM for possible implementation with our Siskiyou County SAR Team.  Not sure if this is an issue with my Firefox 17.0.1 or if I am missing something... or what. 

I can take the sample MM mission and create an offline version. However, I can't open it off line. When I look at the browser offline cache via "about:cache?device=offline", I see that while there are many MM files of various sizes,  all of the "ABC-Offline.php" files are of 0 length and do not have a time listed under "time last modified".   So they are not downloading.

I suppose the next thing to do would be a fresh install of Firefox and give it another try  :o But does this issue ring any bells for anyone?

Thanks-

Matt
Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 05, 2013, 09:57:35 PM
Just did a off-line test on FF and is worked OK.  You might try clearing the offline cache and try again.  See this page for help clearing the cache: http://support.mozilla.org/en-US/kb/how-clear-firefox-cache (http://support.mozilla.org/en-US/kb/how-clear-firefox-cache)

Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 05, 2013, 10:22:25 PM
I did clear the cache several times.  It's pretty clear now the issue is with my browser, so I'll move forward from there.

Thanks for the confirmation!

Great program- you guys have done a lot of good work.

Matt
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 07, 2013, 07:17:47 PM
Sigh.  I can't let it go. I finally got the offline function to work on Chrome (woohoo).  However, I also tried two different Firefox installs on two different machines, even reset FF on one machine... and still no joy.

For some reason, both the Firefox's I am using do not download the offline PHP files (but download other MM files).  The PHP files have zero data size, and no date modified.

This is as close as I have gotten so far finding something on the web that describes what I am experiencing... there is a lot of blorp in the post but a few of the comments fit the symptoms:

http://stackoverflow.com/questions/8303785/html5-cache-manifest-working-great-on-chrome-but-not-on-firefox-and-opera

There is one comment in the above that  says the following:

Check your cache in about:cache. I am betting you will see "data-size 0 bytes" for your PHP file(s).

Check your caching headers, I found in Firefox the default was "no-cache" on my php files. I just added:

header("Pragma: public");
header("Cache-Control: public, max-age=6000");

to my PHP file and reloaded the offline cache and it is finally working.


OK, so I checked a few of the "-Offline.php" files and couldn't find those header lines. However, I did find it in the source code for "manifest.php", where it says:

Cache-Control: no-cache
Pragma: no-cache


Could those be the lines in question?  I am way over my head on this, so I accept that I could be barking up the wrong tree. 

Woof,

Matt

Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 08, 2013, 09:59:48 AM
Wow, I'm impressed you've looked into this so much!  Seems like there is some sort of FF bug happening. 

As an experiment I added the Cache lines to the Clues-Offline.php ONLY.  Let's see if this single file comes to the cache for you.  If it does I'll make the changes to the other files.

Let me know what happens, and thanks for your efforts.

Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 08, 2013, 08:15:27 PM
Bingo.

I nuked the Firefox cache and then did a missions download. Now when I look at the FF cache (via about:cache) I can see the only PHP file with any size is... Clues-Offline.php! And while in an offline mode, I can manually enter the file name and look at the page. Which is something I could not do before. The ADD CLUES button doesn't do anything... maybe because it wants to go to a page that also requires a Firefox work around.

So this seems like it is on the right track. If you can tweak the other files,  I will give it a try and let you know if I am able to bask in the full glory of an offline mission accessed by Firefox.


Matt

Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 08, 2013, 10:48:40 PM
Great!  What a strange FF bug  ???.  For some reason my FF was still working fine for off-line.

OK, I think I added the new cache code to all the other offline .PHP files.  Give it another go and see what happens.  Let me know if you have anymore 0 byte files.

Thanks again for your persistence.

Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 09, 2013, 07:00:45 AM
I think we just about have it.  Looking at the cache, there were a couple files still at zero-  see the attached screen shot.

-Those files appear to do with the offline login screen. So on the face of it, when you're offline, nothing appears to work.

-For some reason, the cache had two zero  listings for OfflineCache.php.  Don't know why. I blasted the cache before creating a new offline file.

-If I pasted the link to the offline missions page directly to the browser (Missions-Offline.php), then  I was bypassing the login screen and Lo! I had the rest of the offline pages available to me.  It was pretty cool.

Are you using an older FF version? I think I had version 12 or 13, and when I initially had this issue I upgraded to 17, thinking that might help. So maybe this is a 'later version' issue.  If you vaporize your cache... do you get the issue, too?  Maybe it doesn't matter, if we're this close to working it out now.

Thanks again!

Matt


Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 09, 2013, 05:00:13 PM
OK, I think I've got this all sorted.  I was using an older version of FF.  Even though FF was set to auto update, it took two forced updates to get the latest version.  After I had the latest version, I was seeing the same issues.

After a lot of fussing I think its all working again.

Thanks for your help!

Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 09, 2013, 07:41:08 PM
Danger, Will Robinson (wave wave).   

OK, I recycled my cache and now when I am online and go to the Missions screen, I don't see any button (anywhere) that will download a mission. When I click Offline Missions I see:

Mission Manager can be used offline without an Internet Connection. Your current browser doesn't support this feature, if you use Google Chrome or Mozilla Firefox this feature will automaticly be enabled.


...I would have ignored all this to begin with, honest, but I couldn't get Chrome to install new on one of my machines, it just sat there when I tried to use it, reinstall after reinstall...

Matt
Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 09, 2013, 09:49:42 PM
Quote
Mission Manager can be used offline without an Internet Connection.
Woops!  My bad, last second change before posting the live code to the web.  A refresh should fix.

Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 10, 2013, 07:39:35 AM
Hmmm... here's what I'm seeing now:

-Firefox off line, go to https://www.radishworks.com/SearchManager/Login.php... get the page "Firefox is currently in offline mode and can't browse the Web."  Ie, FF does not appear to fall back to Login-Offline.php.

-In Chrome off line, it behaves as expected... going to Login.php actually goes to Login-Offline.php. HOwever, this appears to be a generic screen... tells you are you are logged in, and the team you are on, gives you options to Logout or Change Password. Across the top are mission related buttons.  So you can't really go anywhere from there.

-In FF off line you can manually tell it to Login-Offline.php and see the same thing as in Chrome.

-If I'm offline and manually enter Missions-Offline.php in either browser, things work in an offline mode as expected (woohoo!).

-FF off line, if I manually tell it to go to the Missions.php screen, it goes to a cached copy of that page. It doens't go to the content of the Missions-Offline.php.

It's like the way FF uses the fallback function is glitched.

Matt
Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 10, 2013, 07:16:53 PM
Quote
It's like the way FF uses the fallback function is glitched.
Well sorta...  FF is rather strange when it comes to being "offline" - I assume you are using the "Work Offline" feature that FF has in the "File" menu.  When you use this (any maybe other FF "offline" modes) FF does its best to use its Cached pages and pretty much ignores its offline cached pages.  I'm not sure this is a bug or by design, but as you see Chrome works a little differently.  Basically the "fallback" I think you are talking about is the one in the Manifest file.  FF seems to ignore this unless the browser really can't find the Web.  Offline web apps are pretty tricky business.  To make matters worse, it seems that the latest versions of FF are tweaking the way offline caching works. Yikes!

Here's what I added:  I found a way to detect the "Work Offline" change in FF and added some code in MM that will try to swap to the correct page.  I don't think its 100% full proof but it should help catch this situation.   

It sounds like you are getting things working, I hope this helps a little more.

Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 10, 2013, 08:59:06 PM
I dunno. Here's what I experienced:

Prior to going Offline: clear cache, download missions, close browser

I can either pull the ethernet plug OR put FF into Work Offline mode, and the following is the same:

Open browser (either plug is pulled, or, put brower into work offline mode at this point)

Open MM Login page, goes to offline "Logged In" page... however, no links available on this page to go to a mission... aside from mission tabs at the top, the buttons are for Logout or Change Password.

Randomly select one of the mission tabs above (eg, Checkin-Offline.php)

Go to that page

Click Leave Mission at bottom of page

Takes you  to Mission Manager page, click Offline Missions... No missions available in "Offline Missions"- the downloaded missions are not showing.

...So to sum up, the initial offline login page doesn't take you anywhere, and when you finally do get to the Missions-Offline page, there are no downloaded missions.

I am appreciating your patience in this, since it is enough to drive me to several adult beverages.

Matt

Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 10, 2013, 10:50:13 PM
Quote
clear cache
Can you confirm you are clearing both the "Cached Web Content" and the "Offline Web Content and User Data"?

Can you post a screen shot of what the empty Missions-Offline page?  It might give me a clue as to what's happening here?

Thanks again for your efforts.

Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 11, 2013, 07:41:31 PM
Hey Mike-

Affirm- clearing both "Cached Web Content" and the "Offline Web Content and User Data".  Attached is the screen shot of Missions-Offline.

It seemed like we had it working a few iterations ago.  Going to the login page didn't seem to work then, but the Missions page did.

Thanks for sticking with this-

Matt
Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 12, 2013, 08:57:21 AM
I'm beginning to wonder is there is some security software that is somehow blocking offline data somehow.  Bare with me, there is some investigation questions below.  You seem to have some pretty good technical abilities so I'm going to give you some advanced hints as to what to look at.

When you are in FF and online, do you then see both the offline and online missions?  Your online screen should look the first image below.

After you are clearing all the caches, when you are first downloading a mission FF will open a message at the top of the page (its not real obvious so its easy to miss), this message will ask you if the site can store data on your computer, see the message boxed in red on the 2nd image below.  It's possible that you won't see this message depending on the setting "[] Tell me when a web site asks to store data for offline use" in the FF Options box.  (see the last attached image below). 

If you are not seeing offline missions when you are online like the image below, then there is a problem with localStorage.  localStorage is different from the offline page cache and its where MM stores all its offline mission data.  There is a FF addon that lets you view this data here: https://addons.mozilla.org/en-US/firefox/addon/firestorage/ (https://addons.mozilla.org/en-US/firefox/addon/firestorage/).  If you see the missions when online, but they are not there offline, I'm at a loss!

Good Luck,
Mike
Title: Re: Offline- php files don't seem to download
Post by: M.Holmes on January 13, 2013, 08:59:02 PM
Victory!

I came home last night from our SAR snow mobile/snow cat training and started to noodle around with this again.  I used "Local Storage Explorer" and "Firebug" to look at what MM was doing behind the scenes and found that my latest issue was a cookie issue. Once I set FF to accept Radishworks cookies and not clear them after a session, it all worked. (This is in addition to not clearing the cache or offline website data). Your comment about security software got me thinking about privacy settings. Seems obvious to me now that I should have considered the role of cookies.

So now I can happily download missions and mess with them offline and then send them back online.  Having some trouble with offline team personnel not returning to available status after the team is finished/debriefed,   but that is something I am completely happy to poke away on for the time being.

Again, my sincere thanks for your time to help me wade through this. 

Matt


Title: Re: Offline- php files don't seem to download
Post by: Radishworks on January 13, 2013, 10:38:11 PM
Great news!  Thanks for the update.

Mike  :)