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

export messages json is 0 bytes #169

Closed
7 tasks done
QuestioningEspecialy opened this issue May 11, 2024 · 15 comments · Fixed by #139
Closed
7 tasks done

export messages json is 0 bytes #169

QuestioningEspecialy opened this issue May 11, 2024 · 15 comments · Fixed by #139
Labels
bug Something is not working

Comments

@QuestioningEspecialy
Copy link

Checklist

  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected app version

1.0.1

Affected Android/Custom ROM version

Android 14 / GrapheneOS

Affected device model

Google Pixel 6a

How did you install the app?

GitHub releases

Steps to reproduce the bug

  1. open app
  2. gear icon
  3. Export messages
  4. leave name as is and both boxes (Export SMS & MMS) checked
  5. OK
  6. navigate to file from File Manager or desktop
  7. notice its "0 bytes" file size

Expected behavior

should be atleast a kilobyte, but probably over 300MB by now

Actual behavior

its file size ain't even a byte 😐

Screenshots/Screen recordings

No response

Additional information

n/a

@QuestioningEspecialy QuestioningEspecialy added bug Something is not working needs triage Issue is not yet ready for PR authors to take up labels May 11, 2024
@Aga-C
Copy link
Member

Aga-C commented May 11, 2024

  1. Just to be sure - have you checked if the file really has no data? Because it can be working, but for a some reason Android reports wrong file size.
  2. Does it work when you check to export only SMS?
  3. When exporting, do you see a toast message informing that the export has been successful?

@Aga-C Aga-C added question Further information is requested waiting for author If the author does not respond, the issue will be closed. Otherwise, the label will be removed. labels May 11, 2024
@naveensingh
Copy link
Member

naveensingh commented May 11, 2024

Because it can be working, but for a some reason Android reports wrong file size.

This has happened to me too. The file size was correct when I checked using a file manager but it was 0 bytes only in the document file picker. It could be that the file was still being written, FossifyOrg/General-Discussion#120 will at least clear up the progress issue.

@QuestioningEspecialy
Copy link
Author

@Aga-C

  1. is there a quick way to check without temporarily installing a different messenger app? don't want duplicates in my primary messenger 🤷🏿‍♂️
  2. exporting SMS alone does work, but exporting MMS alone doesn't
  3. only when exporting SMS alone

@naveensingh
i've only checked with Fossify's File Manager and my desktop Windows Explorer (or whatever the general folder system's called)
not sure what the "document file picker" is, but those exports from yesterday are still 0 bytes on my phone

@github-actions github-actions bot removed the waiting for author If the author does not respond, the issue will be closed. Otherwise, the label will be removed. label May 11, 2024
@Aga-C
Copy link
Member

Aga-C commented May 11, 2024

 is there a quick way to check without temporarily installing a different messenger app? don't want duplicates in my primary messenger 🤷🏿‍♂️

You could open it as a text file in any file manager app. You can even open it on your desktop in Notepad. I was only interested if there's any data in a file because Android can report file size wrongly.

 but exporting MMS alone doesn't

If there's no data in a file, it sounds like it can be a similar problem as #6, but for some reason the app doesn't crash in your case. Maybe the same fix will help. In that issue, the author of the fix uploaded an APK file - you can check if it also addresses your problem.

@QuestioningEspecialy
Copy link
Author

@Aga-C
the 0 byte json's are empty in HTML Viewer, Vanadium (a browser), and a document viewer
i'll try out the fix later

@Aga-C Aga-C removed the question Further information is requested label May 11, 2024
@tom93
Copy link
Contributor

tom93 commented May 19, 2024

@QuestioningEspecialy I can't reproduce the new SecurityException (#6 (comment)). Have you tried stock Android, or only GrapheneOS? And which file picker are you using?
(I tested in an emulator running Android 14, device definition Pixel 6a, architecture x86_64 because the emulator didn't support arm64-v8a in my setup; command: avdmanager create avd --name pixel_6a -k "system-images;android-34;default;x86_64" -d pixel_6a)
I don't think the SecurityException is caused by my patch. Probably the patch is allowing the app to progress further and encounter the SecurityException. If you can get the debug logs it would probably be helpful.
Another thing to try (easy but only marginally useful) is to switch back to the official release and export just SMS, and then just MMS; hopefully one of them would be small enough for the export to progress, and either succeed or run into the same SecurityException (the aim is to pinpoint whether the SecurityException is caused by the debug release or something else).

@QuestioningEspecialy
Copy link
Author

@tom93 i've only used GrapheneOS and FossifyOrg's File Manager (if i understood you correctly)
i might the the debug logs process later 😑

@tom93
Copy link
Contributor

tom93 commented May 21, 2024

The file picker is the app that asks you to pick the destination folder. It opens after you tap "OK" in dialog for choosing what to export (SMS/MMS). You should be able to tell by the appearance whether it's a native file manager or Fossify File Manager.

I tested with Fossify File Manager as the file picker on Android (I had to run pm hide com.android.documentsui as root to avoid using the native file manager), but I still didn't get the SecurityException.

I can't find an easy way to run GrapheneOS in an emulator. Speaking for myself (since I'm not on the Fossify team), I think the GrapheneOS team should take a look at this and let us know whether it's a bug in GrapheneOS or the Fossify apps, because it's working fine on Android and I can't find an easy way to test on GrapheneOS. They should be able to reproduce the issue using the official release of Fossify Messages from GitHub or F-Droid; they'll just need to ensure that the export is small, otherwise they'll run into the same issue that you initially ran into (#6).

If you'd like to back up your messages soon, it might be possible to find a temporary workaround (e.g. use Android's sharing API to transfer the exported file to another app such as the file manager).

@ghost
Copy link

ghost commented Jun 30, 2024

If I had a nickel for every time a FOSS messaging app messed up backup/restore, I'd have two nickels, which isn't a lot but it's weird that it happened twice (the other being QUIK sms)

@DaGeek247
Copy link

DaGeek247 commented Jul 6, 2024

I have the same issue. If i only export MMS or SMS, it will work fine. If I try to export both, it fails. The file it creates on failure are definitely empty.

@tom93
Copy link
Contributor

tom93 commented Jul 7, 2024 via email

@DaGeek247
Copy link

DaGeek247 commented Jul 7, 2024

are you getting a crash?

Nope, just a failure to write anything after creating the empty file.

What precisely happens during the failed import after you tap "OK"?

I press export, I select the documents folder as the save location with the default name. It then shows the little "Exporting" notification at the bottom of the screen. After 15 seconds, the settings screen switches back to the text conversations screen on it's own. The new file has no data in it.

What are the file sizes of the successful individual SMS and MMS exports?

47.42MB for the MMS file, and 2.15MB for the SMS file.

And please check you have enough available storage.

Oh it definitely has the space. 67GB free on the phone storage.

@Aga-C Aga-C removed the needs triage Issue is not yet ready for PR authors to take up label Jul 7, 2024
@tom93
Copy link
Contributor

tom93 commented Jul 7, 2024

@DaGeek247:

After 15 seconds, the settings screen switches back to the text conversations screen on it's own.

That's odd. The app is supposed to stay on the Settings screen after the export finishes.
And the code should display either "Exporting successful", or an error message, or a crash dialog when the export finishes (so in all cases you should see something).
The only explanation I can think of is that the OS is terminating the activity.
Are you using Android or GrapheneOS? And which version?

I tried to reproduce the issue using backups of a similar size in an emulator (Android 14), but the export worked fine (and was pretty fast).
I don't know if it could be an out-of-memory issue. On the one hand, 50MB isn't that big. On the other hand, the only difference between individual SMS/MMS export and combined export should be the size (and time).
I think my APK with the out-of-memory fix (#6 (comment)) might still be worth a shot. Even better would be a debug build that displays more information. (And best of all would be the logcat output...)

@DaGeek247
Copy link

DaGeek247 commented Jul 7, 2024

Are you using Android or GrapheneOS? And which version?

Android 13, OnUI 5.1, Google Play November 1, 2023, Security Patch June 1, 2024, S20FE 5G.

The custom patched version exported successfully. The current f-droid version (1.0.1) continues to repeatably fail to export sms and mms at the same time.

@tom93
Copy link
Contributor

tom93 commented Jul 8, 2024

The custom patched version exported successfully.

Cool, so this should be fixed once #139 is merged & released.

I was mistaken about the crash dialog -- Android can silently restart the app without giving any indication that there was a crash. On Android 14, the dialog "[app] keeps stopping" is only displayed if the app crashed multiple times within a short time period; further, in my testing I couldn't make the dialog appear a second time unless I reinstalled the app.

@QuestioningEspecialy, given all this, I believe you are running into the same bug after all (the confirmation would be if the app switches to the conversation list after the export instead of staying on the Settings screen). So just wait until #139 is merged & released.

Also, I worked out why you got the SecurityException. You wrote

after finding a way around setting it as the new default app just so i can open it (App info > Additional settings in the app)

At first I misread this and thought you just had some trouble making it the default messaging app, but now I realise that you managed to open the app without making it the default messaging app. This isn't supported, and can't be supported because the Google Play policy requirements say

Apps must be actively registered as the default SMS, Phone, or Assistant handler before prompting users to accept any of SMS or Call Log permissions. Those apps must immediately stop using the permission when they're no longer the default handler.

So the "bug" is that when the app is launched using your clever workaround (App info > Additional settings in the app) it doesn't ask you to make it the default messaging app. It should ask you do make it the default messaging app, because otherwise it can't do anything useful (it's not supposed to request any SMS permissions due to the Google Play policy, and without permissions it will just get a SecurityException).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@DaGeek247 @tom93 @naveensingh @Aga-C @QuestioningEspecialy and others