wordpress-mobile / wordpress-mobile/WordPress-Android

ArrayIndexOutOfBoundsException: length=7; index=-1

Open
#20,618 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Pri] Medium [Type] Crash Aztec Gutenberg Posting/Editing
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Sentry Issue: JETPACK-ANDROID-D3V

java.lang.ArrayIndexOutOfBoundsException: length=7; index=-1
    at android.widget.Editor$PositionListener.addSubscriber(Editor.java:3429)
    at android.widget.Editor$HandleView.show(Editor.java:4901)
    at android.widget.Editor$SelectionModifierCursorController.initHandles(Editor.java:6539)
    at android.widget.Editor$SelectionModifierCursorController.show(Editor.java:6523)
    at android.widget.SelectionActionModeHelper.startActionMode(SelectionActionModeHelper.java:303)
    at android.widget.SelectionActionModeHelper.startSelectionActionMode(SelectionActionModeHelper.java:281)
    at android.widget.SelectionActionModeHelper.startSelectionActionModeAsync(SelectionActionModeHelper.java:148)
    at android.widget.Editor.startSelectionActionModeAsync(Editor.java:2388)
    at android.widget.TextView.performAccessibilityActionInternal(TextView.java:12347)
    at android.view.View$AccessibilityDelegate.performAccessibilityAction(View.java:30152)
    at androidx.core.view.AccessibilityDelegateCompat$Api16Impl.performAccessibilityAction(AccessibilityDelegateCompat.java:430)
    at androidx.core.view.AccessibilityDelegateCompat.performAccessibilityAction(AccessibilityDelegateCompat.java:368)
    at com.facebook.react.uimanager.ReactAccessibilityDelegate.performAccessibilityAction(ReactAccessibilityDelegate.java:615)

Sentry Issue: WORDPRESS-ANDROID-2S8H

java.lang.ArrayIndexOutOfBoundsException: length=7; index=-1
    at android.widget.Editor$PositionListener.addSubscriber(Editor.java:3492)
    at android.widget.Editor$HandleView.show(Editor.java:4976)
    at android.widget.Editor$InsertionHandleView.show(Editor.java:5787)
    at android.widget.Editor$InsertionPointCursorController.show(Editor.java:6460)
    at android.widget.Editor.onTouchUpEvent(Editor.java:2683)
    at android.widget.TextView.onTouchEvent(TextView.java:11338)
    at org.wordpress.aztec.AztecText.onTouchEvent(AztecText.kt:695)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with AztecText.kt at line 695 and compare that touch path with the ReactAccessibilityDelegate stack trace. Review the linked Sentry reports to determine whether the crashes share a cause and identify a reproducible selection or accessibility action. Done means the reported ArrayIndexOutOfBoundsException no longer occurs in both paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.