ccomeaux / boardgamegeek4android

BoardGameGeek application for Android (unofficial)
GNU General Public License v3.0
226 stars 47 forks source link

Problem with importing backuped Collection view/Game/User #152

Open Kaligula0 opened 4 years ago

Kaligula0 commented 4 years ago

I exported all 3 long time ago. A while ago, after an install of recent version, I wanted to restore them but I couldn't and I can't, the files are unclickable, nothing happens. I mean export/import on this screen Screenshot_20200622-110720 Files exported previously, now can't be imported. Screenshot_20200622-110709

Is this problem on my side or anyone else has this problem, too?

mjsztainbok commented 3 years ago

I have the same problem. The files are greyed out in the file selector. Screenshot_20200822-191451_Files

ccomeaux commented 3 years ago

The import logic is quite different between Android versions before KitKat 4.4 (SDK 19). What versions of the OS are you running?

mjsztainbok commented 3 years ago

Android 10 Screenshot_20200924-002645_Settings

Kaligula0 commented 3 years ago

Android 9 @ Sony Xperia XZ1 Compact (G8441)

Kaligula0 commented 2 years ago

Does that commit dc8f16bc6f32f9117d21cebd6ab06172f25873a5 address this issue? :smiley:

If not, maybe this makes problems? Sorry, if this is silly, I know nothing of Java/Kotlin, I'm just trying to get this resolved :(

KleineGelbe commented 2 years ago

I just came across this issue (Samsung S20+ with latest android). I'm not sure if it helps, but my husband just found a workaround.

We exported the files to my Google Drive account, edited the files with my PC and imported the files in the app. The progress bar wouldn't move but that was the only "problem" I had. Every saved view was restored.

Kaligula0 commented 2 years ago

Nice trick, but either doesn't work for me or I'm doing sth wrong. Could you please explain more details?

  1. Now I see that if I export a new backup to Google Drive it can be imported from Drive.
  2. And files (old or new) exported to internal/external SD card cannot be imported from SD.
  3. Files exported to SD and uploaded to Drive cannot be imported from Drive.
  4. Files exported to Drive, not edited, and downloaded to SD can be imported from SD - but in System File Picker they can be selected only via "Downloads" tab or "Latest" tab (cannot be selected browsing "Internal SD" or "External SD").
  5. Files exported to Drive, edited on PC (Notepad++) and reuploaded cannot be imported from Drive.

    *) sorry if translation of these names is not 100% accurate, I don't use English language Android system

Kaligula0 commented 2 years ago

UPDATE to 4th case in previous post.

I checked it. I can import any (new and old!) backup via System File Picker from SD but only from "Downloads" or "Latest". This happened after I exported one backup to Google Drive and downloaded it (I wrote above that such files can be imported, pure case 4th). Then I deleted the downloaded file. And I copied an old backup to Download directory. Then, while trying to import, the System File Picker showed the old file (in "Downloads" or "Latest" only) as selectable. BUT. It showed the timestamp and filesize of the removed file! It looks like there's a bug somewhere (File Picker, system or BGG4A) that fools the app (or the File Picker) thus letting me select the old backup. And of course it only works if the desired file has the same name as the downloaded one.

Finally I imported what I wanted. But I'm not sure it will work next time 🤷‍♂️

Pretty weird thing...

timepieces141 commented 2 years ago

I had this issue yesterday on the latest version (6.8.1) of BGG4A. When I navigated to Google Drive, where I had uploaded the files for safe keeping, I found that the recently exported files were not selectable. I downloaded them, but that didn't change anything. But I had old backups on Drive that were selectable, which was when I remembered I had this issue before. But I didn't remember how to fix it.

I will point out that Google Drive reported the newly exported files as "unknown" file type (even though they have .json extension and text contents). But my old backups (which presumably I did something to to make them importable) reported the type as Text.

My vague recollection was that I copied the contents to new files. So I made copies of the files I knew worked and copied in the contents of the recently exported files. Which worked.

This makes me think there is an encoding issue. I'm a software engineer, but I've only dabbled in tutorials for Android/Kotlin. Is it possible that when an app requests a file manager to pick a file, it places filters on the file types it will take? And if so, might it go beyond the extension to the encoding of the contents? If so, it's possible the export encodes one way (utf-8, let's say), and the import expects another encoding (say, latin-1) - maybe even one of them not enforcing it, and the OS substituting a default.

KleineGelbe commented 2 years ago

Nice trick, but either doesn't work for me or I'm doing sth wrong. Could you please explain more details?

  1. Now I see that if I export a new backup to Google Drive it can be imported from Drive.
  2. And files (old or new) exported to internal/external SD card cannot be imported from SD.
  3. Files exported to SD and uploaded to Drive cannot be imported from Drive.
  4. Files exported to Drive, not edited, and downloaded to SD can be imported from SD - but in System File Picker they can be selected only via "Downloads" tab or "Latest" tab (cannot be selected browsing "Internal SD" or "External SD").
  5. Files exported to Drive, edited on PC (Notepad++) and reuploaded cannot be imported from Drive.

*) sorry if translation of these names is not 100% accurate, I don't use English language Android system

Sorry for the late reply. We've been out all day and just came in. I did an export directly to my Google Drive Main Folder. (Not sure how it is called in English as I'm using it in German). Used the "new" Google Drive Windows App (where you're drive folder is mounted as G:) to sync the file with my PC (Win 10). Then I copied the content of an old export to the new file with Notepad++. I let Google do it's sync and voila.

We thought it might be a file rights issue.

Kaligula0 commented 2 years ago

I hereby confirm that exporting a file to Google Drive + editing content of that file + importing that same file (with new content) = WORKS. Just like @KleineGelbe and @timepieces141 said before. Thank you! What a heck of struggle! :(

Kaligula0 commented 2 years ago

@ccomeaux Can you export backups to phone memory and import them back? I wonder if it's app-dependent or phone-dependent issue.

Kaligula0 commented 2 years ago

The issue still exists on Samsung Galaxy S22 with latest Android 12 in latest BGG4A v6.8.2 app. Still the same workaround works.

Kaligula0 commented 2 years ago

Just for reference – the same issue thread in BGG guild: https://boardgamegeek.com/thread/2869756/importexport-backup.