AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

[Bug]: Deleting text on Android causes text to duplicate.

Open DanielBCoffaro opened this issue 4 months ago • 19 comments

What happened?

When attempting to delete text on Android the text is deleted but then whatever was deleted is duplicated many times. This is happening on Android Pixel 8 in both the app and on the web.

Distribution version

Linux

App Version

0.23.2

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

  • [x] Yes

Self-hosting Version

0.23.2

Relevant log output


Anything else?

No response

DanielBCoffaro avatar Aug 08 '25 12:08 DanielBCoffaro

Issue Status: 🆕 *Untriaged

*🆕 Untriaged

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

affine-issue-bot[bot] avatar Aug 08 '25 12:08 affine-issue-bot[bot]

I have noticed similar text input problems on my Samsung S23. Sometimes, using autocorrect will type in the text, but the app doesn't seem to know it's there. If you hit backspace, it erases text from the middle of the sentence as if what was inserted didn't exist. Closing the document, losing my changes, and reopening it is the only way I found around those desyncs.

kawazoe avatar Aug 09 '25 16:08 kawazoe

This is happening with the Futo Keyboard but doesn't seem to happen with Gboard.

DanielBCoffaro avatar Aug 12 '25 06:08 DanielBCoffaro

This is happening with the Futo Keyboard but doesn't seem to happen with Gboard.

I've seen it on the Samsung keyboard, but I'm not sure this is an android specific issue anymore. I've seen something similar on Firefox (Linux) on my laptop as well. I had strange thing happen when copy/pasting text and deleting text in the middle of words.

More poeple reported this: #13043

kawazoe avatar Aug 20 '25 01:08 kawazoe

I also experienced the same on android. 0.24.1 app and server. self-hosted, but happens on locally stored docs as well.

When tapping underlined text (where the cursor is), or any content within the same block the underlined text is duplicated. When altering in any way, same behavior. Only pressing Enter/Return to start a new line/block is it not duplicating, and in case of initial input in new lines. Cursor can be moved via space bar sliding without duplication as well.

I used HeliBoard keyboard.

EDIT: After some testing this issue has to do with the word suggestion and/or grammar correction feature. With that turned off, editing works fine.

GetAwayWithThis avatar Sep 15 '25 08:09 GetAwayWithThis

Having identical issue with florisboard here. This is a critical bug that should get addressed immediately. It is a complete showstopper and not something that should go unaddressed for months.

EDIT: App version is 0.24.2

pompydev avatar Sep 29 '25 12:09 pompydev

I'm able to reproduce the bug in https://try-blocksuite.vercel.app

pompydev avatar Sep 29 '25 12:09 pompydev

Happens with Heliboard too

rightsaidfred99 avatar Oct 01 '25 01:10 rightsaidfred99

I also have this issue. Here's some documentation on it and a video of the behavior: https://community.affine.pro/c/bug-reports/strange-typing-behavior-on-android

Key points discovered:

  • Happens in all client and server configurations: affine cloud with android app, self-host with android app, self-host accessed through browser
  • Happens in all network configurations: wifi, airplane mode, cell network
  • Happens regardless of keyboard used or its settings

eriteric avatar Oct 06 '25 12:10 eriteric

I am having trouble seeing how this isn't the absolute top priority for the project. Not only is text input the main way users will interact with Affine, there have also been multiple people reporting this issue through multiple different means for months now. It isn't a good sign when someone have the time to figure out how to self-host Obsidian and migrate over all of their content before a major issue like this is fixed.

Right now, text input is borderline unusable. You can't copy/paste, accept a correction, or suggestions, or auto-correct, on pretty much every devices out there, and the issue isn't even triaged yet.

Meanwhile, nearly all of the most recent commits to this projects are about adding AI and paid integrations.

kawazoe avatar Oct 06 '25 20:10 kawazoe

I agree, it's a litmus test for mine. Dipping my toes in Affine... but I can't see it being a seriour project when a huge issue like this exists for months.

rightsaidfred99 avatar Oct 06 '25 20:10 rightsaidfred99

I dont know if my issue is related, but in my android app I cannot edit text really. I can type something, but when I hit Enter or sometimes even just Space, the text disappears again. Should I open a new Issue for that?

nhrlyn1 avatar Oct 23 '25 09:10 nhrlyn1

Just a heads up to try the latest v0.1.26 release of FUTO Keyboard. I have had no crazy text duplication issues or bugs using the AFFiNE app with it, even with spelling suggestions enabled. Have not tested on web app, so ymmv there.

nooz avatar Oct 23 '25 23:10 nooz

Switching to gboard (previously on my tab s8’s default samsung keyboard) seems to have resolved the issue for me

nhrlyn1 avatar Oct 24 '25 09:10 nhrlyn1

Quoting from Discord, seems to be an official account:

silencer.xyz — Yesterday at 9:57 PM We noted this one for sure. Since our Android developer just left the firm a few weeks ago and we are looking for a new androd developer at the moment. That's why we can't make progress on Andorid side at the moment. We will figure this out soon tho!

halr9000 avatar Nov 03 '25 14:11 halr9000

Switching to gboard (previously on my tab s8’s default samsung keyboard) seems to have resolved the issue for me

Using GBoard here, bug is same but different. :(

halr9000 avatar Nov 03 '25 14:11 halr9000

Related posts on Discord:

  1. Cannot edit text in AFFiNE Android when using certain type of Keyboard
  2. Android: Line content is deleted when pressing space
  3. Android: text gets duplicated when pressing backspace

Interestingly, I found very similar bugs in the notes app Capacities. Won't link to that, but same basic symptoms. I suspect both are using the same editor control which has the same bugs. :(

halr9000 avatar Nov 03 '25 14:11 halr9000

I found some similar issues from react native:

  • https://github.com/facebook/react-native/issues/11068
  • https://github.com/facebook/react-native/issues/30503
  • https://github.com/facebook/react-native/issues/34668

I'll try and open a PR today if I'm able to fix it this after school.

pompydev avatar Nov 04 '25 04:11 pompydev

I tried to implement a fix but it touches more things than I am comfortable with as a new contributor but someone who is familiar with the codebase should be able to fix it with relative ease.

This commit (https://github.com/facebook/react-native/commit/ab3c00de2ca1cff959c724c09f7f61c3706b2904) explains the problem really well:

How the issue happened:

  • User types: A (ComposingText Span becomes (0,1), composingWord: "A")
  • Javascript replaced A with a, ComposingText Span was removed from getText()
  • User types a new character: r (ComposingText, defaulting to selection, from selection, empty string is replaced with word "Ar") => Complete text: aAr => letter duplication.

How it works with the changes applied:

  • User types: A (ComposingText Span becomes (0,1), composingWord: "A")
  • Javascript replaces A with a, (ComposingText Span (0,1) is re-set after replace)
  • User types a new character: r (ComposingText (0,1), "a" word is replaced with word "Ar". ComposingText becomes (0,2) "Ar")
  • Javascript replaced Ar with ar, (ComposingText Span (0,2) is re-set after replace) => Complete text: ar => no letter duplication
  • User selects suggestion "Are" (ComposingText Span (0,2) "ar" is replaced with new word and space "Are ")
  • CompleteText: "Are "
  • Javascript replaces "Are " with "are " (ComposingText Span doesn't exist, no string after space " ")

@L-Sun @Saul-Mirone Sorry to bother but can you help us figure this one out?

pompydev avatar Nov 04 '25 09:11 pompydev