apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Upload error when point (.) in name

Open nicolas-raoul opened this issue 5 years ago • 25 comments

Steps to reproduce:

  1. Set FakeGPS (or equivalent) to be near this music venue: https://goo.gl/maps/go8ncPKxnDQgWTAD8
  2. Compile the app using the "structured-data" branch (not sure if needed)
  3. Start the app
  4. Go to "Nearby"
  5. Select the item 渋谷La.mama https://www.wikidata.org/wiki/Q64778538
  6. Try to upload this picture for it: 20200411_171501
  7. Upload error:

Screenshot_20200411-171724_Commons

Notice also the truncated name 渋谷La. I have not experienced this with any other item/picture, there must be something special with this one. Sorry I don't have a logcat. I have not tried on master either.

nicolas-raoul avatar Apr 14 '20 11:04 nicolas-raoul

            return uploadInterface.uploadFileToStash(fileNameRequestBody, tokenRequestBody, filePart)
                    .map(stashUploadResponse -> stashUploadResponse.getUpload());

getUpload is null I would say this has nothing to do with structured data though I did test on it. Getting the error response from the API now

macgills avatar Apr 14 '20 11:04 macgills

Right now I am guessing we should replace . with _

macgills avatar Apr 14 '20 11:04 macgills

B-I-N-G-O

{
  "errors": [
    {
      "code": "verification-error",
      "text": "File extension \".mama\" does not match the detected MIME type of the file (image/jpeg).",
      "data": {
        "details": [
          "filetype-mime-mismatch",
          "mama",
          "image/jpeg"
        ]
      },
      "module": "upload"
    }
  ],
  "docref": "See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.",
  "servedby": "mw1281"
}

macgills avatar Apr 14 '20 11:04 macgills

And I'd wager for the second error

   @NonNull public String getDisplayTitle() {
        return filename != null ? getPageTitle().getDisplayTextWithoutNamespace().replaceFirst("[.][^.]+$", "") : "";
    }

this is the culprit

macgills avatar Apr 14 '20 11:04 macgills

This is not related to structuredData so I will remove my assignment

macgills avatar Apr 14 '20 11:04 macgills

Tagging @misaochan @neslihanturan @maskaravivek for suggestions

ashishkumar468 avatar Oct 11 '20 18:10 ashishkumar468

Hmmm, I've never encountered this problem, it seems to be specifically for that particular Wikidata item?

misaochan avatar Oct 12 '20 09:10 misaochan

For all such Wikidata items I guess. Maybe use that item or rename the sandbox item momentarily, and before upload modify title (but not the label(s)) to prevent the problem seen at https://github.com/commons-app/apps-android-commons/issues/3651#issuecomment-613396737?

nicolas-raoul avatar Oct 12 '20 11:10 nicolas-raoul

@nicolas-raoul can I work on this?

shabar-shab avatar Dec 24 '20 07:12 shabar-shab

@shabar-shab Yes, thanks! Please let us know about your progress every few days :-)

nicolas-raoul avatar Dec 24 '20 08:12 nicolas-raoul

@nicolas-raoul can I work on this?

i-am-atif avatar Feb 06 '21 11:02 i-am-atif

@i-am-atif I was not able to reproduce this issue. did you reproduce this issue.

shabar-shab avatar Feb 06 '21 14:02 shabar-shab

@shabar-shab I just tried to reproduce this issue, but failed to do so

i-am-atif avatar Feb 06 '21 15:02 i-am-atif

I was able to upload the image without any error.

i-am-atif avatar Feb 06 '21 15:02 i-am-atif

@i-am-atif Did you follow all the steps exactly, especially step 4? Please post the URL of your uploaded image here, thanks!

nicolas-raoul avatar Feb 17 '21 10:02 nicolas-raoul

Is this issue still open?

sotiriszogos avatar Apr 03 '21 17:04 sotiriszogos

@sotiriszogos Yes! The first step would be to try and reproduce it, possibly by using a sandbox item.

nicolas-raoul avatar Apr 04 '21 07:04 nicolas-raoul

@nicolas-raoul Thank you, I will take a look by the end of the week to reproduce it and work on it if noone is currently working on this issue.

sotiriszogos avatar Apr 06 '21 10:04 sotiriszogos

@shabar-shab Are you still working on this? Please let us know about anything you have found out :-)

nicolas-raoul avatar Apr 06 '21 11:04 nicolas-raoul

Could I work on this? Is it still available?

jmora13 avatar Oct 05 '21 01:10 jmora13

No answer from Shabar, so feel free to work on it @jmora13, thanks! Please let us know about your progress every few days :-)

nicolas-raoul avatar Oct 05 '21 07:10 nicolas-raoul

Hi @nicolas-raoul Is anyone working on this issue? Can I take it up?

bhavanagarlapati avatar Dec 06 '22 08:12 bhavanagarlapati

Hi @nicolas-raoul is anyone working on this issue?? I would like to take this up and work on it.

Thanks

samyak1326 avatar Aug 05 '24 14:08 samyak1326

@samyak1326 Any progress on this? Did you manage to follow the reproduction steps? :-)

nicolas-raoul avatar Aug 26 '24 02:08 nicolas-raoul

Hi @nicolas-raoul , yes, I was able to follow the steps and reproduce the error, and started working on the issue. It might take some more time to conclude. I will try my best.

samyak1326 avatar Aug 29 '24 19:08 samyak1326