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

Caption with trailing whitespace leads to failed upload (titleblacklist-custom-space)

Open nicolas-raoul opened this issue 2 years ago • 4 comments

Latest master.

Steps:

  1. Upload any picture.
  2. At the caption step, enter a name with a space at the end.
  3. The upload seems to be starting fine, but at the end it fails with the logcat error titleblacklist-custom-space.

nicolas-raoul avatar May 20 '22 14:05 nicolas-raoul

@nicolas-raoul Hi, can I work on this issue?

Jiaweeeeeen avatar Oct 17 '22 02:10 Jiaweeeeeen

@Jiaweeeeeen Yes thanks! :-) Did you manage to reproduce the issue?

nicolas-raoul avatar Oct 17 '22 03:10 nicolas-raoul

@nicolas-raoul I haven't reproduced the issue. Is it the same step you provide above?

Jiaweeeeeen avatar Oct 17 '22 03:10 Jiaweeeeeen

Yes, it might take a few attempts in various situations.

nicolas-raoul avatar Oct 17 '22 03:10 nicolas-raoul

I think the solution could be to add a method in UploadMediaDetailInputFilter.java to check the trailing whitespace in the caption field. Then in the filter, if the input text has any trailing whitespace, simply remove it. I'm going to implement these methods and hope the solution works.

Jiaweeeeeen avatar Oct 19 '22 07:10 Jiaweeeeeen

Unfortunately, this solution doesn’t work because any empty space the user types is recognized as trailing space. Instead, I have another solution to remove them after the user typed the caption. Any trailing whitespace will be removed when set to uploadMediaDetails.

Jiaweeeeeen avatar Oct 22 '22 12:10 Jiaweeeeeen