florisboard / florisboard

An open-source keyboard for Android which respects your privacy. Currently in early-beta.
https://florisboard.org
Apache License 2.0
5.86k stars 394 forks source link

Space-Swipe touching delete creates bug. #567

Closed Glitchy-Tozier closed 3 years ago

Glitchy-Tozier commented 3 years ago

Short description

Another fun bug. :) No idea how i find those things but i like it.

Steps to reproduce

  1. Set sidewards space-swipe and delete-swipe to their default actions.
  2. Type text somewhere
  3. Move cursor to middle of text
  4. WITHOUT RAISING YOUR FINGER OFF OF THE KEYBOARD:
    • Space-swipe right
    • Touch enter
    • Then move up and touch the delete key.
  5. See keyboard freak out and delete a lot of characters.

Environment information

patrickgold commented 3 years ago

Thanks for your bug report Glitchy! I have tried to reproduce it on my testing devices but was unable to do so, the space swipe up gesture always triggered instead of the delete bug. Will have to further investigate into this.

Glitchy-Tozier commented 3 years ago

The space-swipe gesture is meant to trigger, but afterwards, when touching the delete-button with your gesture, the cursor jumps back and tons of letters get deleted.

I have a "reproduction-rate" of 100%, but if you want i can tell you whether this still persists in 0.3.10, once that update is avaliable through the play-store. Maybe it was fixed by serendipity :)

Glitchy-Tozier commented 3 years ago

Btw, if there's too little text, the keyboard will crash when performing glitch. Here's the stacktrace:



java.lang.StringIndexOutOfBoundsException: String index out of range: 3
    at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:933)
    at java.lang.StringBuilder.substring(StringBuilder.java:77)
    at dev.patrickgold.florisboard.ime.core.EditorInstance.deleteWordsBeforeCursor(EditorInstance.kt:233)
    at dev.patrickgold.florisboard.ime.text.TextInputManager.handleDeleteWord(TextInputManager.kt:468)
    at dev.patrickgold.florisboard.ime.text.TextInputManager.onInputKeyUp(TextInputManager.kt:704)
    at dev.patrickgold.florisboard.ime.core.InputEventDispatcher$1$3.invokeSuspend(InputEventDispatcher.kt:125)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
~~~ 1617608793212.stacktrace ~~~

java.lang.IndexOutOfBoundsException: Empty list doesn't contain element at index -1.
    at kotlin.collections.EmptyList.get(Collections.kt:36)
    at kotlin.collections.EmptyList.get(Collections.kt:24)
    at dev.patrickgold.florisboard.ime.core.EditorInstance.deleteWordsBeforeCursor(EditorInstance.kt:235)
    at dev.patrickgold.florisboard.ime.text.TextInputManager.handleDeleteWord(TextInputManager.kt:468)
    at dev.patrickgold.florisboard.ime.text.TextInputManager.onInputKeyUp(TextInputManager.kt:704)
    at dev.patrickgold.florisboard.ime.core.InputEventDispatcher$1$3.invokeSuspend(InputEventDispatcher.kt:125)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
~~~ 1617738178963.stacktrace ~~~

java.lang.IndexOutOfBoundsException: Empty list doesn't contain element at index -1.
    at kotlin.collections.EmptyList.get(Collections.kt:36)
    at kotlin.collections.EmptyList.get(Collections.kt:24)
    at dev.patrickgold.florisboard.ime.core.EditorInstance.deleteWordsBeforeCursor(EditorInstance.kt:235)
    at dev.patrickgold.florisboard.ime.text.TextInputManager.handleDeleteWord(TextInputManager.kt:468)
    at dev.patrickgold.florisboard.ime.text.TextInputManager.onInputKeyUp(TextInputManager.kt:704)
    at dev.patrickgold.florisboard.ime.core.InputEventDispatcher$1$3.invokeSuspend(InputEventDispatcher.kt:125)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
patrickgold commented 3 years ago

Hmm yeah best if you tried this one out once v0.3.10 stable is out - on the PlayStore the update should be out either late Friday or Monday.

Glitchy-Tozier commented 3 years ago

Still exists, but somehow it changed. Now not a random amount of characters is deleted, but always the last word. (even though i use CHARACTER-deletion when swiping the space-key)

Can visible pointers be enabled on every Android device? If yes, i can send you a screen capture of the bug.

Glitchy-Tozier commented 3 years ago

Actually, scratch that. I think we accidentally fixed. Now i'm just triggering my space+↑ gesture.

Should we close this issue?

EDIT: This still seems wrong to me. The swipe hitting delete...

  1. Shouldn't be able to trigger another gesture because there's already a gesture going on.
  2. Shouldn't be able to trigger another gesture because the upwards-distance is too small. Touching the delete-button shouldn't set anything in motion.
patrickgold commented 3 years ago

Now i'm just triggering my space+↑ gesture.

That's what it is supposed to do (even though I agree that multiple gestures should not be possible in one go, will have to fix this).

Can visible pointers be enabled on every Android device? If yes, i can send you a screen capture of the bug.

Yes, by going to the developer settings in your system settings (if you haven't used them before you have to tap your build number in the phone info screen 7 times to be able to access them, then it will permanently be an option in your system settings).

In the dev options, scroll down until you find a "Show taps" toggle and turn it on (don't know the German translation for it), but it is very far down on my phone. Then there's a visual feedback for your taps, which should be picked up by the screen recorder.

Glitchy-Tozier commented 3 years ago

Nice, thank you, it worked! :)

I knew there was a way on LG, but i wasn't sure whether it was universal.

Should we close this issue? (as it's somewhat of a duplicate of the double-gesture issue)

patrickgold commented 3 years ago

Yes I think we should close this issue and continue in #487.

Glitchy-Tozier commented 3 years ago

Kk