maelchiotti / LocalMaterialNotes

Simple, local, material design notes
https://play.google.com/store/apps/details?id=com.maelchiotti.localmaterialnotes
GNU Affero General Public License v3.0
136 stars 10 forks source link

Export doesn't work #219

Closed 1ycx closed 1 month ago

1ycx commented 1 month ago

On Pixel 7 (android 13) and Pixel 9 (android 14 AD1A.240905.004), I tried exporting notes to unencrypted json and it doesn't work. Setting up automatic export doesn't work either.

Any ideas on how to debug?

maelchiotti commented 1 month ago

Hi @1ycx, are you on the very latest version of the app (v1.7.1) that I released yesterday, or on v1.7.0?

1ycx commented 1 month ago

Yes, latest version (downloaded it today, 1.7.1). I also noticed this- after enabling Automatic export and selecting Directory (Settings->Backup->Automatic export->Directory), it doesn't change it there, continues displaying (/storage/emulated/0/Android/data/com.maelchiotti.localmaterialnotes/files/downloads/backups)

maelchiotti commented 1 month ago

Mmh, weird, that version was supposed to improve exports aha, but maybe I made a mistake.

So when you do a manual JSON export, do you get the snack bar that says "The export was successful", or do you get a snack bar with an error message? Or do you get no snack bar at all?

itsmartashub commented 1 month ago

Have the same issue. There's (error) snack for me only for markdown export: Invalid argument(s): Cannot handle u: true. But no any snack for JSON exports, tho

maelchiotti commented 1 month ago

Ah yeah I know where this comes from, the encoder that converts notes to Markdown cannot handle underlines yet. Forgot to handle that case. I'll add a fix in the next release to ignore underlines until I find time to contribute to the editor library so they are supported.

But yeah JSON exports (and so auto exports) should work fine.

maelchiotti commented 1 month ago

I too have the issue where sometimes the chosen folder for auto backups isn't registered - but not always, I'll investigate.

However manual exports work fine for me.

(Also JSON files end in .txt, probably a small mistake that will easily be fixed).

1ycx commented 1 month ago

Mmh, weird, that version was supposed to improve exports aha, but maybe I made a mistake.

So when you do a manual JSON export, do you get the snack bar that says "The export was successful", or do you get a snack bar with an error message? Or do you get no snack bar at all?

No error or snack bar, No files are generated, .txt or .json, the folder is completely empty.

1ycx commented 1 month ago

Looking at the logs, it seems that the file name is too long. Not sure what else is the issue. Screenshot_20241013-141905

1ycx commented 1 month ago

Also, this is what I meant about the automatic export directory (even though the selected directory is something else)-

image

maelchiotti commented 1 month ago

Ok so I've fixed the directory picker, that was causing the issue for automatic export directory, but also could lead the manual export to fail.

However, I can't reproduce the "File name too long" error. Just to be sure, you get it while manually exporting as JSON, right?

1ycx commented 1 month ago

However, I can't reproduce the "File name too long" error. Just to be sure, you get it while manually exporting as JSON, right?

Correct, it shows in system log when I manually export unencrypted json. It seems like a warning though (W) rather than an error (E). Logs were checked using Logfox.

maelchiotti commented 1 month ago

Can you try to export in a directory that is only one folder deep, like directly inside the Document directory but not in a subdirectory?

1ycx commented 1 month ago

Can you try to export in a directory that is only one folder deep, like directly inside the Document directory but not in a subdirectory?

Export works fine this way. I see a json file with all the notes.

maelchiotti commented 1 month ago

Ok so that should be the issue with the directory picker I fixed. No idea why you get that "file name too long" error though.

Let's keep the issue open, I'll publish the new version at the end of the week and you'll tell me if everything works fine.

maelchiotti commented 1 month ago

(Or if you wish you can also install the debug version built in #220 by the GitHub Action.)

itsmartashub commented 1 month ago

I just wanted to let you know that with the debug version #220 this issue seems to be fixed (for me tho). Both manual and automatic JSON export work. The export path is now finally applied to desired one (mine path is 2 folder deep: internal>dir>subdir). I really hope this will resolve all the issues for @1ycx as well.

Once again thanks a lot for your effort and time! 🙏

maelchiotti commented 1 month ago

Great, many thanks for trying the debug version and letting me know!

1ycx commented 1 month ago

Tested debug version #220 , works fine. Just wasn't able to update the installed app, had to uninstall and re-install. Thanks for the quick work!

1ycx commented 1 month ago

I still get the warning saying filename is too long with both json and markdown exports, but I don't see any issue. Perhaps we can deal with it when we have something more concrete to look into. Also, I wonder what significance is of markdown export, maybe to migrate to someother app like Obsidian etc?

maelchiotti commented 1 month ago

Yeah, no idea where the filename too long issue might be coming from. If it works anyway, I guess we'll ignore it for now...

And honestly, it's mainly that the editor library that I use supports exporting to markdown, so I just figured I could add the feature. Don't know if it's useful to anyone, but it could be to migrate to Obsidian or any other markdown-based note-taking apps, as you said.