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 notes" file doesn't have .json extension #13

Closed
6 of 7 tasks
tom93 opened this issue Jan 27, 2024 · 4 comments
Closed
6 of 7 tasks

"Export notes" file doesn't have .json extension #13

tom93 opened this issue Jan 27, 2024 · 4 comments
Labels
bug Something is not working device/software specific Issues that only happen on some devices or with some specific hardware/software

Comments

@tom93
Copy link
Contributor

tom93 commented Jan 27, 2024

Checklist

  • I can reproduce the bug with the latest version given here. N/A (not released yet)
  • 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

SimpleMobileTools 6.17.0 (since FossifyOrg Notes hasn't been released yet)

Affected Android/Custom ROM version

All
Android 9
Happens both when completing the save action using the native Files app and when using Fossfy File Manager.

Affected device model

All
Android-x86 VM
Also a physical device

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

In Settings, click "Export notes".
Observe that the prompt says "Filename (without .json)" and the pre-populated filename does not have a .json suffix.
Click OK. Pick a destination folder.

Expected behavior

The exported file should have a .json file extension.

Actual behavior

The exported file does not have a .json file extension.

Screenshots/Screen recordings

screenshot-1 screenshot-2 screenshot-3 screenshot-4 screenshot-5

Additional information

Fixing this is trivial hopefully trivial, but also raises the question of what should be changed:

A. Obvious fix: Leave the UI as is, and automatically append ".json" when saving. (This is consistent with the automatic backup feature.) Implemented in #14.

B. Change the UI so the prompt is just "Filename" and the initial value includes a ".json" suffix. I like this, because it's simple and direct -- it shows the user that the output will be a .json file without the user having to stop and think (thought process: "What's the output format going to be? Wait, the tiny prompt says "without .json", meaning I don't write .json, meaning the app will probably automatically add .json, so the output is probably .json"). Also allows the user to easily pick a different file extension (e.g. .txt to allow viewing in text editor). However, this is inconsistent with the automatic backup and most of the other apps (e.g. the Calendar export prompt says "without .ics" and automatically appends .ics).

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

Aga-C commented Jan 27, 2024

Have you tested in on multiple real devices? Writing "All" under "Affected Android version" and "Affected device model" is a very bold statement. You should always write on what device you've really encountered it.

I think, it may only affect specific Android versions. On Android 10 (Xiaomi Redmi 7A) and Android 13 (OnePlus 8 Pro, OnePlus 9 Pro) it saves with .json extension. However, I was able to reproduce it on Android 6 (OnePlus 2).

If someone were to fix this, there should be no UI change because similar UI is currently also in other apps. It should only fix that save always saves with proper extension.

@Aga-C Aga-C added device/software specific Issues that only happen on some devices or with some specific hardware/software and removed needs triage Issue is not yet ready for PR authors to take up labels Jan 27, 2024
tom93 added a commit to tom93/FossifyOrg-Notes that referenced this issue Jan 27, 2024
The UI dialog says "Filename (without .json)" and the default value
doesn't have a .json suffix, so we are supposed to automatically
append the file extension (as we already do for automatic backups).

Fixes FossifyOrg#13.
@tom93
Copy link
Contributor Author

tom93 commented Jan 27, 2024

Oops, I added device details (I did test on both a VM and a physical device, and thought it was just a trivial typo, but evidently I was wrong). I guess the file extension is added automatically, either by newer versions of Android or by the file manager app used to pick the destination.

Can you please check that my proposed fix in #14 doesn't break things on the working devices that you've listed? (I'm worried about ending up with .json.json as the file extension, but I'm not able to test on those Android versions myself.)

@tom93 tom93 changed the title [trivial] "Export notes" file doesn't have .json extension "Export notes" file doesn't have .json extension Jan 27, 2024
@p4bl0-
Copy link

p4bl0- commented Jan 30, 2024

I don't mind it but can confirm that the .json extension is missing on my install (v6.17 of the app on Android 13).

@tom93
Copy link
Contributor Author

tom93 commented Jan 31, 2024

I did more testing and my conclusion is that the native Files app automatically adds the extension since Android 10 (tested on Android 9, 10, 14). Fossify File Manager never adds an extension (tested on Android 9, 10; couldn't test on Android 14 because it uses the native Files app without letting me choose Fossify File Manager).

So I think the simplest solution is to always add the extension in the Notes app. It fixes the missing extension issue, and as far as I can tell it has no negative consequences -- it doesn't cause double extensions, and for duplicates, the versions of the Files app that can add the extension automatically (Android 10+) correctly insert the "(1)" before the extension even when the extension was added by the Notes app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working device/software specific Issues that only happen on some devices or with some specific hardware/software
Projects
None yet
Development

No branches or pull requests

3 participants