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

fix(android/engine): Ignore updating invalid selections #11510

Merged
merged 2 commits into from
May 24, 2024

Conversation

darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented May 23, 2024

Fixes #11506
Fixes KEYMAN-ANDROID-3A2
Fixes KEYMAN-ANDROID-3Z4 (second time)

This adds more sanity-checking to KMKeyboard.updateSelectionRange(). Will 🍒 pick to stable-17.0

Don't attempt to process selection if

  • text is empty
  • selection is past the current text

I can verify these hit the debugger (selMax is 23 when the raw text length is 23). But I can't repro the crashes in the Sentry issue.

User Testing

Setup - Install the PR build of Keyman for Android

  • TEST_INVALID_SELECTIONS - Verifies app does not crash on invalid selections
  1. Launch Keyman
  2. In the Keyman app, type some text
  3. Move the cursor to earlier in the text
  4. Move the cursor past the text
  5. Verify cursor is at the right of the text

@darcywong00 darcywong00 requested a review from sgschantz as a code owner May 23, 2024 04:08
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels May 23, 2024
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented May 23, 2024

User Test Results

Test specification and instructions

  • TEST_INVALID_SELECTIONS (PASSED): I tested this issue with the attached "Keyman 18.0.42-alpha-test-11510" build on an Android 14(physical device: Samsung Galaxy A23) environment: Here is my observation. (notes)

Test Artifacts

@dinakaranr
Copy link

Test Results

  • TEST_INVALID_SELECTIONS (PASSED): I tested this issue with the attached "Keyman 18.0.42-alpha-test-11510" build on an Android 14(physical device: Samsung Galaxy A23) environment: Here is my observation.
  1. Installed the "Keyman 18.0.42.apk" file and gave all permissions to the application.
  2. Checked the "Enable Keyman as system-wide keyboard" and set the keyboard as the default keyboard box on the settings page.
  3. Open the Keyman text editor.
  4. Enter a sentence text.
  5. Move the cursor to earlier in the text.
  6. Move the cursor past the text.
    Here, Observed that the cursor is present at the right of the text. It works well. Thank you.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label May 23, 2024
@mcdurdin mcdurdin merged commit 688d59f into master May 24, 2024
5 checks passed
@mcdurdin mcdurdin deleted the fix/android/substring-index-length branch May 24, 2024 06:52
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 18.0.44-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(android): StringIndexOutOfBoundsException index > length
4 participants