Search and Replace breaks, then often deletes all document text [$50]

Bug #1453622 reported by Felipe Escoto
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Scratch
Fix Released
Critical
Corentin Noël

Bug Description

Search and replacing changes are often reverted, or they will dellete everything, saving the changes

Related branches

Revision history for this message
Cody Garver (codygarver) wrote :
Revision history for this message
Cody Garver (codygarver) wrote :
Revision history for this message
Cody Garver (codygarver) wrote :

I experience this at least once a day but I have not yet figured out steps to reproduce

Changed in scratch:
importance: Undecided → Critical
milestone: none → freya-0.3.1
Revision history for this message
Lewis Goddard (lewisgoddard) wrote :

Once a day? I got this about 10 times in half-an-hour!

Changed in scratch:
status: New → Confirmed
Revision history for this message
Lewis Goddard (lewisgoddard) wrote :

This is al the output I get when run from the terminal:

[_LOG_LEVEL_WARN 16:51:04.898709] [GLib-GObject] /build/buildd/glib2.0-2.42.2/./gobject/gsignal.c:2579: instance '0x7f96bc007910' has no handler with id '4776'
[_LOG_LEVEL_INFO 16:51:06.394722] Document.vala:307: File "header.php" saved succesfully

Revision history for this message
Lewis Goddard (lewisgoddard) wrote :

My previous comment was when files where having their changes reverted. This is the output from when changes were reverted twice, then the file was cleared by Scratch.

[_LOG_LEVEL_WARN 16:52:38.240760] [GLib-GObject] /build/buildd/glib2.0-2.42.2/./gobject/gsignal.c:2579: instance '0x7f96bc007910' has no handler with id '6072'
[_LOG_LEVEL_INFO 16:52:40.489721] Document.vala:307: File "header.php" saved succesfully
[_LOG_LEVEL_WARN 16:52:46.906230] [GLib-GObject] /build/buildd/glib2.0-2.42.2/./gobject/gsignal.c:2579: instance '0x7f96bc007910' has no handler with id '6493'
[_LOG_LEVEL_INFO 16:52:49.298687] Document.vala:307: File "header.php" saved succesfully
[_LOG_LEVEL_WARN 16:52:53.586170] [GLib-GObject] /build/buildd/glib2.0-2.42.2/./gobject/gsignal.c:2579: instance '0x7f96bc007910' has no handler with id '6829'
[_LOG_LEVEL_WARN 16:52:55.228806] Document.vala:294: Cannot save "header.php": The file is externally modified
[_LOG_LEVEL_INFO 16:52:56.303220] Document.vala:307: File "header.php" saved succesfully
[_LOG_LEVEL_INFO 16:52:58.153666] Document.vala:307: File "header.php" saved succesfully

Note that Ctrl+Z seems to take me back to the empty document. I presume that the replace-all button is clearing the document and then putting the new text in, which is causing the data-loss problem, but isn't the trigger itself.

Revision history for this message
Lewis Goddard (lewisgoddard) wrote :

Okay, reproduction steps (I hope):

1. git clone https://github.com/elementary/mvp.git
2. Open "_templates/header.php"
3. Search for "sitewide" and press enter a couple of times in that same box.
4. Put something like "special" in the replace box and press replace all.
5. Observer that they have all changed.
6. Click anywhere in the document and they will either all change back or the document will empty.
7. Ctrl+Z or Undo will result in an empty document, followed by the correctly replaced items you saw a few seconds ago.

Revision history for this message
Lewis Goddard (lewisgoddard) wrote :

If you turn off auto-save, you will see how modifications seem to be made outside of scratch and the reloaded in.

Revision history for this message
Lewis Goddard (lewisgoddard) wrote :
Cody Garver (codygarver)
Changed in scratch:
assignee: nobody → Corentin Noël (tintou)
status: Confirmed → Fix Committed
tags: added: bounty
summary: - Search and Replace breaks, then often deletes all document text
+ Search and Replace breaks, then often deletes all document text [$50]
Revision history for this message
Lewis Goddard (lewisgoddard) wrote :

As far as I can tell the attached branch has not fixed this bug.

Revision history for this message
Gero.Bare (gero-bare) wrote :

The newly appended branch mitigates the bug but still this part of the bug stands

When using replace all function, scratch still creates an empty file entry in the history.

To reproduce:
* use replace all.
* Then go back in the save history of that file (undo), it appears a blank file/empty file.

Changed in scratch:
milestone: freya-0.3.1 → 2.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.