Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JP Social/Message] Text field in message edit screen can get over max length #19013

Open
thomashorta opened this issue Aug 21, 2023 · 0 comments

Comments

@thomashorta
Copy link
Contributor

The first message set to the text field in the share message edit screen is the post title. That field has a maximum length controlled by the onValueChange callback of the OutlinedTextField, but that callback is not triggered when the text is set by us when the Activity opens.

The problem with this is: if the post title is longer than the maximum length, we are setting it to the text field anyway. As soon as the user tries editing the message it is truncated as expected, but there was an instance of a single crash regarding Accessibility that might be related with that bug.

social-share-message-max-length-bug.mp4

Expected behavior

Right now when we have an empty message we default to the post title, and, at the very least, I would expect the post title to be truncated to the share message max length.

Another possible expectation would be having the field empty with some info saying the title will be used as default, which seems to be the current backend behavior, but that might be risky since we don't know if the backend truncates the title, nor if that behavior could change.

Actual behavior

The message field is set with the full post title, even when it's longer than the max length, and when the user types something in the field, it truncates to the proper maximum length.

Steps to reproduce the behavior

Have an account with JP Social configured and at least 1 social connection.

  1. Open Jetpack
  2. Create a new post
  3. Use a really long title (over 255 characters)
  4. Tap publish
  5. Tap the Social item
  6. Tap the message option
  7. Verify the message has the full title
  8. Type in the field
  9. Verify the message was truncated to the max-length (255 chars)
Tested on emulator, Android 13, JPAndroid 23.0-rc-1/trunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants