Implement an asynchronous transaction manager module

Assigned to



Async Tooling
4 years ago
4 years ago


(Reporter: WeirdAl, Assigned: WeirdAl)


(Blocks: 1 bug)


Firefox Tracking Flags

(Not tracked)




(1 attachment)



4 years ago
I think I will break this patch up into several incremental patches:

* Inline API documentation, errors and basic infrastructure (stack of transactions, PromiseAction, isInTransaction)
* doTransaction
* undoTransaction
* redoTransaction
* Transaction listeners
* Merging transactions
* Transaction metadata
* Undo / redo stacks (getting, clearing)

Each phase will have its own tests as well.

Comment 1

4 years ago
Created attachment 8519454 [details] [diff] [review]
part 1:  Define the API.
Attachment #8519454 - Flags: review?(dteller)
Can you describe the expected use case for this ATM?
Flags: needinfo?(ajvincent)
Comment on attachment 8519454 [details] [diff] [review]
part 1:  Define the API.

Review of attachment 8519454 [details] [diff] [review]:

At first glance, the API looks sound, but I can't review it until I have a good idea of the usecase.
Attachment #8519454 - Flags: review?(dteller)

Comment 4

4 years ago
The immediate use case is Firefox's addons manager:

You may recall that the AOM uses several sychronous nsIFile operations to update an addon, for instance.  AOM's actually implementing a simple transaction with its SafeInstallOperation code.  Bug 945540 is about converting to OS.File and Promises for asynchronous operations, so it could use the Transaction code I've implemented.

(That being said, AOM may not require the full AsyncTransactionManager, just a singleton Transaction.  I'm willing to redesign for that purpose only, if you require this.)

Mozilla's built-in transaction manager component (editor/txmgr) supports undo/redo operations in general, but is not designed for asynchronous operations.  I implemented AsyncTransactionManager for that purpose in my Verbosio project, so that I could have undo and redo capabilities for async, atomic changes.
Flags: needinfo?(ajvincent)
You need to log in before you can comment on or make changes to this bug.