-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure transactions are always #505
Conversation
Although I think ^ should be added, this wont address all cases (or even that many cases) as.
Question is, should we enforce the commit, or implement a "abort" transaction. let needsAbort = true;
try {
env.begin();
env.commit();
needsAbort = false; // everything went ok, no abort required.
} finally {
if (needsAbort) {
env.abort();
}
} Alternatively, one could remove the assertion and merely assume |
Rather then enforcing the caller to be aware of this. I change the PR to take a different approach.
|
There are different ways we can skin this cat, would love others opinions. |
let transaction = this._transaction; | ||
if (transaction) { | ||
this._transaction = null; | ||
LOGGER.warn('a glimmer transaction was begun, but one already exists. You may have a nested transaction'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw in debug
This looks good |
* ensure running `commit` always clears the current transaction * if we begin a transaction with an existing transaction warn, commit it, then start begin the next.
I like the fix, I'm not crazy about the test, why not throw on a component hook once like didInsertElement and test that you can rerender again? |
fixes #484