Redoing Undo?
Perry Wagle
wagle at mac.com
Wed Oct 26 18:24:32 UTC 2016
> On Oct 26, 2016, at 10:31 AM, Richard Newman <rnewman at mozilla.com> wrote:
>
> To speak to part of this:
>
> To head that off, I’d like to fix rollbacks in general. So here I am, asking for what other people want from it.
>
> "Undo" is a really tricky problem if the data makes it to the database.
>
> You can't roll back the transaction (it's committed).
There was code for cancelling/rolling-back. Remnants are still there. I just looked at the top level so far, so I don’t know exactly how it does it other than accumulating a buffer of changes.
I can get tricksy, but don’t know if I can do that enough to solve the problems.
> You can't just write the old state directly to the DB — as soon as the change hits the database, Sync is going to upload those changes, altering metadata as it goes. (In general, you cannot write directly to Places at all.)
>
> And writing a computed reverse-diff through the API is also hard to get right — by the time you try to change things back, Sync might have merged in new changes.
Oh! Didn’t think about sync and this problem. It’s a real problem, and I will have to think about it. I do want to have multiple readers/writers to the databases in the future, so it needs to get solved. The sync guys will care about it, so at least maybe I’m not alone.
> If data doesn't hit the database… well, that's another set of problems.
Yeah. I’ve been thinking about the problems involved in using in-memory databases for speed. I have no comfortable solutions yet (for persistence, etc).
>
> The editor window is too small and unresizable, the tag list changes width as you scroll it, etc. With my two extensions, tags are now (with ESR45) quite useful, and you can have minutes long sessions editing tags, making cancel a necessity.
>
> If you're making changes over the course of minutes, and those changes are applied to Places, then those changes have synced to other devices and might indeed change underneath you during editing.
Getting sync to work right seems to help me maintain consistency with multiple readers and writers. Rolling back would confuse sync though, I’ll need to study that one. But just undo brings up the rollback problem.
Interesting!
Thanks for bringing up sync. It was the sort of thing I was fishing for!
— Perry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20161026/8244af7d/attachment.html>
More information about the firefox-dev
mailing list