OpenArchive / Save-app-android-old

This is the Save app for Android
https://open-archive.org
GNU General Public License v3.0
94 stars 25 forks source link

Bulk editing the name field (only) leads to incomplete batch upload, i.e. only one file uploads to server #510

Closed foundscapes closed 11 months ago

foundscapes commented 11 months ago

Describe the bug If bulk editing the "name" field for multiple files, only one file uploads to the server, even though app says all files uploaded. Works fine if we’re not bulk editing the metadata fields, just the "name" field.

To Reproduce Steps to reproduce the behavior:

  1. Add multiple files to upload
  2. Long-press to select multiple files for bulk editing
  3. Bulk edit the name field so all names are consistent
  4. Check the server to see if all files were uploaded

Expected behavior All files in bulk upload (3) should be on the server.

Actual behavior Only one of the (3) files in the bulk upload was on the server.

Screenshots

IMG_9419

Screenshot 2023-10-23 at 12 11 02 PM

Environment (please complete the following information):

tladesignz commented 11 months ago

LOL OMG

That happened, because "name" is actually a new requirement which sneaked in via a innocuous design change.

We had "people" before. Editing the "name" is new.

For iOS (which is my reference), the name of the file was actually never editabl. It was either the original file name, or, if that was not determinable, a globally unique identifier plus correct filename extension, to avoid this exact problem.

On Android, there is a "name" field on the "Media" class, and I just used that in the rush, without thinking.

Turns out, that's actually the filename.

So, let's start to clarify what this actually should do by walking through these questions:

To consider: These filename clashes are the exact reason, why we didn't let anybody edit filenames in the first place.

If you really want to have the users edit the filename, you're also buying into having a complex solution to make sure the filenames don't clash. (And I deliberately use the word "buying" here - that'll cost you time and money!)

tladesignz commented 11 months ago
foundscapes commented 11 months ago

Thank you, this all makes sense. Let's remove the field for now (we don't need a name/title field since we have the notes field) and if there is a huge need for in-app file-renaming from the community, we can discuss the more complex solution at a later date.

tladesignz commented 11 months ago

But also don't bring back the "people" metadata?

foundscapes commented 11 months ago

right! just remove the field, thanks!

tladesignz commented 11 months ago

@purvi-ranawat, this will be contained in version 0.3.0-beta4 due for release on Friday, 29th.

foundscapes commented 11 months ago

@tladesignz for future consideration: since changing the name of the file is only an issue with batch uploading (can't have multiple files in one folder w/ same name), is there a way to include the "name" field for individual uploads and not for bulk/batch? ty!

tladesignz commented 11 months ago

@tladesignz for future consideration: since changing the name of the file is only an issue with batch uploading

No, it isn't. It's always a consideration. Folks could rename files the same, manually.

foundscapes commented 11 months ago

right, but couldn't the app automatically add a number after each if it's the same name as it does on most computers? This feature was requested by a number of our communities, so it'd be nice to revisit once critical bugs and ux updates are finished.

tladesignz commented 11 months ago

Please create a new issue for that feature with a proper description of what should actually be achieved! Thank you!