auto-save for a task description sometimes moves the cursor back to the start of the textbox #1850

Open
opened 2021-10-21 03:10:14 +00:00 by figwinterberry · 6 comments

I am using v0.18.1 of both the frontend and the backend.

When editing a task's description in either Safari v13.1.2 (macos High Sierra) or Chrome 94 (latest), I sometimes experience annoying behaviour with the auto-save feature. When the autosave completes, it will move the text cursor to the start of the textbox. This means when I continue typing, the text appears to be at the front. Sometimes the autosave even gets into a loop, where it switches between text I have typed at the start of the description and where I was typing beforehand.

the problem seems more likely to occur if I start typing while the auto-save is in progress.

It would be great if there was an option in the user settings to disable this feature. I don't have any issues when editing comments, as they don't have the auto-save functionality.

I am using v0.18.1 of both the frontend and the backend. When editing a task's description in either Safari v13.1.2 (macos High Sierra) or Chrome 94 (latest), I sometimes experience annoying behaviour with the auto-save feature. When the autosave completes, it will move the text cursor to the start of the textbox. This means when I continue typing, the text appears to be at the front. Sometimes the autosave even gets into a loop, where it switches between text I have typed at the start of the description and where I was typing beforehand. the problem seems more likely to occur if I start typing while the auto-save is in progress. It would be great if there was an option in the user settings to disable this feature. I don't have any issues when editing comments, as they don't have the auto-save functionality.
Owner

I wouldn't even call that a feature, thats a bug.

Just to be sure, that only happens when editing the task description?

We plan to replace the editor in general with something else (#781) which will hopefully make that problem go away.

I wouldn't even call that a feature, thats a bug. Just to be sure, that only happens when editing the task description? We plan to replace the editor in general with something else (#781) which will hopefully make that problem go away.
konrad added the
kind/bug
label 2021-10-21 05:32:09 +00:00
Author

Yes, definitely a bug. And yes, I've only seen this behaviour when editing task description, due to auto-save.

Yes, definitely a bug. And yes, I've only seen this behaviour when editing task description, due to auto-save.
Contributor

It seems that the autosaving is sometimes racing with itself. There are a couple of points I've noticed:

  • After saving, it restores the string that it saved, removing anything that was typed since
  • However, it might have in the meantime started another save of what was typed since, leading to an infinite loop of auto saving between two states
  • It seems to me that auto save is not debounced hard enough to only happen after typing has stopped, or should not be restoring the value it saved if it has changed since.
It seems that the autosaving is sometimes racing with itself. There are a couple of points I've noticed: * After saving, it restores the string that it saved, removing anything that was typed since * However, it might have in the meantime started another save of what was typed since, leading to an infinite loop of auto saving between two states * It seems to me that auto save is not debounced hard enough to only happen after typing has stopped, or should not be restoring the value it saved if it has changed since.
Owner

@freaktechnik Thanks for your observations.

I think the easiest way to fix that would be to either

  • Disable autosave completely
  • Increase the autosave debounce to something longer, maybe 10 seconds
  • Cancel any save requests which are currently running when the user types again

A combination of the last two is probably the way to go.

It sounds a bit like the speed of internet connection plays a role here. Did you check that, maybe with the connection emulator in chrome?

@freaktechnik Thanks for your observations. I think the easiest way to fix that would be to either * Disable autosave completely * Increase the autosave debounce to something longer, maybe 10 seconds * Cancel any save requests which are currently running when the user types again A combination of the last two is probably the way to go. It sounds a bit like the speed of internet connection plays a role here. Did you check that, maybe with the connection emulator in chrome?
Contributor

To avoid what I'm seeing if anything the save would have to be faster, since what happens is

  • I start typing/interacting with the editor (could also be using some wysiwyg button)
  • Autosave triggers for "Foo"
  • I continue adding input " bar"
  • Autosave completes and restores the editor contents to "Foo"

Making the network slower would only make this worse.

To avoid what I'm seeing if anything the save would have to be faster, since what happens is * I start typing/interacting with the editor (could also be using some wysiwyg button) * Autosave triggers for "Foo" * I continue adding input " bar" * Autosave completes and restores the editor contents to "Foo" Making the network slower would only make this worse.
Owner

Is this still an issue?

Is this still an issue?
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1850
No description provided.