Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache not added to history if unsaved and logged from popup #4086

Closed
Bjurran opened this issue Jul 18, 2014 · 57 comments
Closed

Cache not added to history if unsaved and logged from popup #4086

Bjurran opened this issue Jul 18, 2014 · 57 comments
Assignees
Labels

Comments

@Bjurran
Copy link

@Bjurran Bjurran commented Jul 18, 2014

Been running the latest nightly builds for som time now and there's one annoying bug with the ones I've used this week. The history doesn't contain all the offline logs resulting in missing found logs when exporting the feild notes. I noticed this the first time July 16th and it's the same today.
All caches are saved and updated on the phone prior to caching.
The offline logs are saved and I'm able to open the logs from the individual caches, but they simply don't appear in the history.
Today 2 of the caches are not shown, last time it was 3 or 4.
Currently running 2014-07-18-NB1-0822830 and can confirm that the bug is still there.

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Jul 18, 2014

two out of how many? anything special about them or their log?
I tried a little, but couldn't reproduce it up front, so more input to isolate the behaviour could help. If you want you can also create a backup of your cache db and send it to support, so I could take a look if there is a data inconsistency I could spot. But be aware that this database will contain quite an amount of personal information which we of course would treat confidential. But it will not include passwords or the like.

@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Jul 18, 2014

Thanks for your reply. Today I found 9 traditional, 7 of them show up in the history.
2 days ago I found 18 traditional and 1 mystery. 4 of the found traditional caches are missing in the history. Also saved a comment on another traditional, that comment was included (and for some reason the saved comment shows up as a happy smiley on the map but I guess that would have to be another bug report)

There's really nothing special about them, the only thing I can think about is that I did also use the personal cache note for all of the caches where this happens to write down clues for a final cache (only simple clues such as A=1)

Attaching 2 screenshots to show one of the missing ones from today is saved but not showing up in the list.

screenshot_2014-07-18-23-55-09
screenshot_2014-07-18-23-57-26

Now, I tried to export my database but I can' manage to find it on my phone. Where should I look for it?

@marco-dev

This comment has been minimized.

Copy link
Contributor

@marco-dev marco-dev commented Jul 19, 2014

@Bjurran
The directory is hidden for "normal" file managers. You have to enable to show hidden e.g. in ES File Explorer APP. The directory should be /sdcard/.cgeo .

@marco-dev

This comment has been minimized.

Copy link
Contributor

@marco-dev marco-dev commented Jul 19, 2014

I guess you mean backup, not export. Export already shows the directory you export to. /sdcard/gpx for gpx export or /sdcard/field-notes for fueld-notes.

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Jul 19, 2014

Thank you for the detailed description. The personal cache note might really be an indicator, at least something to start with.
If your file explorer doesn't show you the /sdcard/.cgeo-Folder, Ghostcommander will.

Off topic: Tyvärr kommer jag inte till Värmland det här året, annars hade jag tagit chansen att fråga efter några recommendationer. Men Småland är inte så dåligt heller :)

@marco-dev

This comment has been minimized.

Copy link
Contributor

@marco-dev marco-dev commented Jul 19, 2014

You can backup database at settings/system. This copies the database to /sdcard/.cgeo/cgeo.sqlite

@marco-dev

This comment has been minimized.

Copy link
Contributor

@marco-dev marco-dev commented Jul 19, 2014

@rsudev
ES File Explorer will show it with menu Tools/Show hidden files on.

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 19, 2014

I think this just occured to me today.
I composed an offline log from the live map without opening and/or saving the cache beforehand.
Afterward I stored it.
Now it is shown in list and on map as offline logged, but missing in history.

@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Jul 19, 2014

I can find a .cgeo with a few hundred GC folders with map files but there's no cgeo.sqlite folder there.
Same thing on both the phone (nexus 5, Android 4.4.4) and computer with hidden files visible. What's the actual file name I should be looking for and I'll try to search for that

Regarding having the caches saved, I always have them saved and updated before I start to look for a cache. I've tried to remember in which order I saved the info. I think I saved the cache note and uploaded it first. (btw, pretty annoying to have to scroll all the way back again just to upload it when it's a long description)
After that saved the offline log and when back to the live map.
I always navigate with the map, I don't search for nearby caches as I already have them saved and on the map.

Unfortunatelly I'm running out of caches nearby so I haven't been able to test it much today. The only one I found worked properly but I didn't use the cache note so it's not the same scenario if that's related to the issue.

@Lineflyer Did you use the personal cache note or can we rule that part out?

@marco-dev

This comment has been minimized.

Copy link
Contributor

@marco-dev marco-dev commented Jul 19, 2014

@Bjurran
The file cgeo.sqlite is created if you do a backup of your db file in cgeo. You can do this at cgeo settings/system/backup.

You can't see / copy the database file itself because other apps can't access the internal storage of cgeo.

@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Jul 19, 2014

@marco-dev
I managed to find the 15.1 MB file now using ES File Explorer and copied it to my download folder which worked fine on the computer. (I kept looking for a folder with that name)
What's the easiest way for me to send it to you guys? (Not sure what the file size limit is on my hotmail)

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 19, 2014

@Bjurran Seems you looked for a folder. cgeo.sqlite should be a file directly in /.cgeo

@marco-dev

This comment has been minimized.

Copy link
Contributor

@marco-dev marco-dev commented Jul 19, 2014

@Bjurran
Depends on email system. You can also put it on a web storage like dropbox and provide a link via email or in this issue.

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Jul 19, 2014

@Bjurran If you zip it, it should get much smaller and easily be sent to support@cgeo.org
Otherwise you can send a Dropbox-link (or similar) as @marco-dev suggested to the same address.

@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Jul 19, 2014

Ok, got it. You'll have a mail soon. Just trying to find some of the GC# I know didn't work =)

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 19, 2014

Received and forwarded to the involved devs.

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Jul 19, 2014

Can it be that GC57DFD and GC57DG2 are not visible in history and should?
I will be investigating further tomorrow evening...

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 19, 2014

yes, see forwarded mail text.

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Jul 20, 2014

I looked further into the matter and it seems to be clear that the display side of things is correct. I assume a data-race under some conditions when logging offline.

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 20, 2014

Please try this to reproduce:

  • Open live map on a location where no caches are stored with strategy "Detailed" as PM
  • Out of those caches shown with precise coords (without orange circle....loaded by implicit nearby search) select a random one and click it
  • On the popup select Overflow -> Log visit offline -> Found
  • Return to main menu
  • Select "History"

The offline logged cache does not show up.
That was my senario mentioned above, however I did not recheck/reproduce up to now.

@Lineflyer Lineflyer added Bug labels Jul 20, 2014
@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Jul 20, 2014

That's not the correct scenario, I've had all the caches saved prior to being out in the field and as I happened to have 4G reception I updated them individually before I attempted any of them.
The offline logs are save to the cache and visible if I open it up again, but simply doesn't show up in the history resulting in not being exported to the field note.

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 21, 2014

@Bjurran Yes, your scenario might be another condition leading to the same fault. I will tryy to reproduce your scenario as well.

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 23, 2014

@Bjurran I failed in the first step to reproduce your scenario. Do you remember whether you only stored the personal note locally or also uploaded it to the website?

Facts are (please correct if wrong):

  • Cache is saved offline
  • Logging is invoked from cache details and then saved
@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Jul 24, 2014

I uploaded all of the personal notes to the website.

What I'm not sure about is if I did it in the same order on all of them, in case there's a difference when I save the offline log before/after uploading the note.

Can confirm those facts. All of them are saved and updated just before I started looking for them so I should have had all the details for all of them, not just the data from my PQ.

@MrYaz

This comment has been minimized.

Copy link

@MrYaz MrYaz commented Aug 30, 2014

I can verify this bug in NB 2014.08.30-NB

How to reproduce

  • Go to an area on the map where you have no stored caches.
  • Select a random cache, "Cache #1" on map
  • On the popup, select Overflow -> Log Visit
  • Enter a short text and press Back
  • Confirmation tooltip says "c:goe successfully saved your log"
  • Next select another random cache on the same map, "Cache #2"
  • On the popup, press on "More info" button
  • From the cache details page, select Overflow -> Log Visit
  • Enter a short text and press Back
  • Confirmation tooltip says "c:goe successfully saved your log"
  • Next select History from the main menu
  • Cache #1 is missing from the list
  • Only Cache #2 is listed
  • On the map both caches are marked as found.
  • In cache details Cache #1 has the status "Saved Log"
  • but Cache #2 has the status "Saved Log(2014/08/30)"
@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Aug 30, 2014

I haven't been out much lately and haven't checked this in a while.
However, Thanks for that MrYaz, now we know that we can rule out the personal cache note as you never used that part.

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Oct 13, 2014

Confirmed with 2014.10.12-NB according to the scenario desrcibed by @MrYaz

The summary is:
A cache is not added to the history if it is unsaved and directly logged from the live map popup without opening it before (no details present).

Modifying the issue title accordingly.

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Jul 14, 2016

This is really one of the long runners which I ofter get confronted with on support mails.
Can anyone try to tackle this?

Here is a recent support mail (extract):

I haven’t heard much about this issue since opening my ticket back on 4/9/2015. I was burned by using the store logs offline feature at that time and really haven’t used it much since. This past weekend I did a power trail in Oklahoma and was thinking the feature was fixed. Haha…

When I got home, I used the filter option in Cgeo to pull up all caches with offline notes. 86 caches came up. Hum, I know that is not correct for I just knew we found more. Here is what I found and hopefully this will help solve the issue.
[...]
When I pulled up the filter option to find caches with offline logs. The filter pulled up only those caches that I had loaded to my phone before the trip. They were offline caches, even though I was using the live map feature in Cgeo to cache by.
[...]
Those caches I found and put an offline log on, that were not load previously, in other words, were on my live map view as real time, those caches were not found by the filter HOWEVER, if I used the search function in Cgeo, either by name or GC code, they were found and my notes were still there. Just had to find each one manually, which was a huge pain.

So again, I was burned by the offline log feature

If the programmers want Cgeo to continue to be used by geocachers, this year old issues really needs to be resolved.

@samueltardieu

This comment has been minimized.

Copy link
Member

@samueltardieu samueltardieu commented Jul 18, 2016

One obvious solution would be to disable logging and navigation from the popup. But that would probably not be the most friendly way.

@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Aug 29, 2016

It's been more than 2 years since I started this thread. Any progress here?
Version 2016.08.27, same issue still.
Downloaded two caches (one traditional, one mystery) to a list to be certain I had all data. Saved the logs as offline logs, and none of them are visible from found caches. If I go to the live map they are shown with a red smiley.

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Aug 30, 2016

Hi @Bjurran

It's been more than 2 years since I started this thread. Any progress here?

No, sadly no one of our small team had the time to research/debug this issue.

Downloaded two caches (one traditional, one mystery) to a list to be certain I had all data. Saved the logs as offline logs, and none of them are visible from found caches. If I go to the live map they are shown with a red smiley.

That is strange compared to the latest clues we had on this issue:
IMHO only unsaved caches should be affected and only if the are logged from the popup window on live map. In your case non of these conditions apply. Are you sure...I am doing the same thing all the day when caching and don't miss a cache in the history.

@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Aug 30, 2016

That is strange compared to the latest clues we had on this issue: IMHO only unsaved caches should be affected and only if the are logged from the popup window on live map. In your case non of these conditions apply. Are you sure...I am doing the same thing all the day when caching and don't miss a cache in the history.

I had to read my old posts regarding this and as far as I can tell, I've had issues with caches saved back in 2014. This time, I know for a fact that the traditional was saved from the live map, and the mystery was saved by searching for the GC and saving it. I know I had all the data as it was shown on the correct position on the map as I was close enough to use the live map while driving towards it.

@pstorch

This comment has been minimized.

Copy link
Contributor

@pstorch pstorch commented Aug 30, 2016

Interesting bug. Just did some short investigations.

The History list searches for geocaches in table cg_caches with visiteddate > 0 and detailed = 1 (optionally filtering by cache Type).

If saving an offline log without prior saving the cache only an entry in table cg_logs_offline is added. So it can't find it.

If you save the cache and the offline log from the Map popup the visiteddate is not set correctly. Don't know yet, why.

I would like to continue on this one.

@pstorch pstorch self-assigned this Aug 30, 2016
@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Aug 31, 2016

That would be great. It seems detailed=1 is the first problem as unsaved caches with offline los might be missing on history then.

edit by rsudev: there was some data attached looking like something that should stay private.
edit by SammysHP: Removed full email quotation. ;)

@Lineflyer

This comment has been minimized.

Copy link
Member

@Lineflyer Lineflyer commented Aug 31, 2016

Just some more thoughts:
It might be a straight forward plan to trigger saving the cache as soon as an offline log is added. That will avoid any necessary case destinctions.
AFAIR we do the same if personal notes are added on an unsaved cache

@pstorch

This comment has been minimized.

Copy link
Contributor

@pstorch pstorch commented Aug 31, 2016

@Lineflyer I was thinking about that, too.

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Aug 31, 2016

There is unfortunately a fundamental difference between the personal note and the popup case - in the personal note case we have the full details (even already in the database if I am not mistaken) and we just need to 'store' it (assign the standard list). In the case of the popup this might not be true and AFAIK is our code tailored to expect only caches with full details in the database.
So for the popup we have two cases IMO:

  1. cache is saved/has full details: If necessary store it to standard list and 'just' fix the visiteddate handling
  2. cache is not fully detailed: I guess here we have no chance other than to revisit our data flow to enable all parts to correctly handle partially available caches...
@Bjurran

This comment has been minimized.

Copy link
Author

@Bjurran Bjurran commented Aug 31, 2016

Glad to see that you are getting closer. I just wanted to ask if any of you have experienced this after importing a gpx? I haven't had time to test that myself.
(just in case there's any difference between importing or saving from the map or searching)

@pstorch

This comment has been minimized.

Copy link
Contributor

@pstorch pstorch commented Aug 31, 2016

I made a small test with saving the cache if not saved yet, before writing the log. I had to use the Geocache.store() method which also downloads the details if necessary. DataStore.saveCache() which is used in CacheDetailActivity.ensureSaved() wasn't sufficient. Now the Offline log showed up in History.

Open issue: when the Phone has no internet connection (e.g. Airplane mode). Then we can't download the missing details and are not able to store the Cache. But we still write the offline log. In this case it's still missing in the History list.

Another strategy could be that the History list also looks in the offline logs table and merges them into the List (if missing). But then we would miss some Data which is present in each list entry.

@Bjurran I use GPXs (Pocket Queries) most of the time and can store offline logs, which show up in History.

Update: @Bjurran not sure anymore, I'll check again

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Aug 31, 2016

@pstorch Downloading the details in case of offline logging is IMO not an option. It just takes too much time when it works and has a high chance of not working at all. Of course this is true whenever you download a cache 'in the field', but then it is an explicit action/choice made by the user, not something that just happens.
And writing an offline log for a cache which is just in memory doesn't sound like an awfully good idea either...

pstorch added a commit to pstorch/cgeo that referenced this issue Aug 31, 2016
@pstorch

This comment has been minimized.

Copy link
Contributor

@pstorch pstorch commented Aug 31, 2016

@rsudev yes, it needs some time. Maybe too long to be acceptable. I've done it Async at the moment, but this has other drawbacks.

What else can we do?
Forbid offline Logs if the cache has not been saved before? Not user friendly either.
Redesign the offline logs table to also contain some basic information about the Cache (e.g. title, type, ...) to be able to show it in the List activity.

Other ideas?

@pstorch

This comment has been minimized.

Copy link
Contributor

@pstorch pstorch commented Sep 1, 2016

Why do we only save caches where detailed = true? We have this flag in the DB and can react on it.
I've made some tests and allowed to save the cache without detailed information. Then the save is fast (doesn't need to download anything) and it shows up in the History.
The CacheDetails can still be opened and details loaded afterwards with refresh.

Still sometimes the visiteddate is not set correctly. I can't find out why, yet. I suspect some race conditions. I'll continue with tests.

@rsudev

This comment has been minimized.

Copy link
Contributor

@rsudev rsudev commented Sep 1, 2016

The history behind this is, that initially all caches were saved in the database always, even the live-map caches. This led to performance issues, and I assume one of the ways to avoid accidental save of a cache to the database was, to explicitly require detailed = true.
It is good to hear that it does not lead to immediate problems, if this restriction is lifted, but we should be careful, that this does not lead to flooding the database with partially downloaded caches.
Perhaps we can require 'personal information' (like an offline log) in addition?

pstorch added a commit to pstorch/cgeo that referenced this issue Sep 13, 2016
pstorch added a commit to pstorch/cgeo that referenced this issue Oct 1, 2016
pstorch added a commit to pstorch/cgeo that referenced this issue Oct 3, 2016
pstorch added a commit to pstorch/cgeo that referenced this issue Oct 4, 2016
pstorch added a commit to pstorch/cgeo that referenced this issue Nov 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.