Skip to content

Do not iterate in while when history cursor is outside of list range - #1065

Merged
khaykov merged 2 commits into
trunkfrom
fix/only-remove-actual-history-items
Nov 6, 2023
Merged

Do not iterate in while when history cursor is outside of list range#1065
khaykov merged 2 commits into
trunkfrom
fix/only-remove-actual-history-items

Conversation

@planarvoid

@planarvoidplanarvoid commented Oct 24, 2023

Copy link
Copy Markdown
Contributor

Fix

This PR fixes the following crash. We shouldn't iterate the list if the cursor points out of it.

IndexOutOfBoundsException: Index: 10, Size: 0
at java.util.LinkedList.checkElementIndex(LinkedList.java:559)
at java.util.LinkedList.remove(LinkedList.java:529)
at org.wordpress.aztec.History.doHandleHistory(History.kt:65)
at org.wordpress.aztec.History$HistoryRunnable.run(History.kt:0)
at android.os.Handler.handleCallback(Handler.java:938)

Test

  1. I think this is a race condition so there is no way to test this

Review

@khaykov

Make sure strings will be translated:

  • If there are new strings that have to be translated, I have added them to the client's strings.xml as a part of the integration PR.

@khaykovkhaykov self-assigned this Nov 6, 2023

@khaykovkhaykov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into reproducing this one some time ago, but no luck. Thanks for handling it!

@khaykov
khaykov merged commit c36ac5f into trunkNov 6, 2023
@khaykov
khaykov deleted the fix/only-remove-actual-history-items branch November 6, 2023 22:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@planarvoid@khaykov