apps-android-commons
apps-android-commons copied to clipboard
Upload error when point (.) in name
Steps to reproduce:
- Set FakeGPS (or equivalent) to be near this music venue: https://goo.gl/maps/go8ncPKxnDQgWTAD8
- Compile the app using the "structured-data" branch (not sure if needed)
- Start the app
- Go to "Nearby"
- Select the item
渋谷La.mamahttps://www.wikidata.org/wiki/Q64778538 - Try to upload this picture for it:

- Upload error:

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.
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
Right now I am guessing we should replace . with _
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"
}
And I'd wager for the second error
@NonNull public String getDisplayTitle() {
return filename != null ? getPageTitle().getDisplayTextWithoutNamespace().replaceFirst("[.][^.]+$", "") : "";
}
this is the culprit
This is not related to structuredData so I will remove my assignment
Tagging @misaochan @neslihanturan @maskaravivek for suggestions
Hmmm, I've never encountered this problem, it seems to be specifically for that particular Wikidata item?
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 can I work on this?
@shabar-shab Yes, thanks! Please let us know about your progress every few days :-)
@nicolas-raoul can I work on this?
@i-am-atif I was not able to reproduce this issue. did you reproduce this issue.
@shabar-shab I just tried to reproduce this issue, but failed to do so
I was able to upload the image without any error.
@i-am-atif Did you follow all the steps exactly, especially step 4? Please post the URL of your uploaded image here, thanks!
Is this issue still open?
@sotiriszogos Yes! The first step would be to try and reproduce it, possibly by using a sandbox item.
@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.
@shabar-shab Are you still working on this? Please let us know about anything you have found out :-)
Could I work on this? Is it still available?
No answer from Shabar, so feel free to work on it @jmora13, thanks! Please let us know about your progress every few days :-)
Hi @nicolas-raoul Is anyone working on this issue? Can I take it up?
Hi @nicolas-raoul is anyone working on this issue?? I would like to take this up and work on it.
Thanks
@samyak1326 Any progress on this? Did you manage to follow the reproduction steps? :-)
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.