-
Notifications
You must be signed in to change notification settings - Fork 554
refactor(tree): Support pausing Tree events for table operations #25298
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
Draft
Josmithr
wants to merge
29
commits into
microsoft:main
Choose a base branch
from
Josmithr:tree/deferred-events-during-transactions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d535c62
docs: TODO plus clean up comment list formatting
Josmithr c36a3db
docs: Add note
Josmithr bca00a7
refactor: Hoist transaction APIs from `TreeViewAlpha` to `TreeBranch`
Josmithr 8967eba
Remove redundant extends clause
Josmithr d4a3e09
docs: Update API report
Josmithr 8d99ddd
docs: Tag `RunTransactionParams` as `@input`
Josmithr 55a69d9
docs: Add changeset
Josmithr 53e0f0b
Merge branch 'main' into tree/move-transaction-api
Josmithr 1292e55
Merge branch 'main' into tree/deferred-events-during-transactions
Josmithr c0f54ed
Merge branch 'tree/move-transaction-api' into tree/deferred-events-du…
Josmithr 0dc1740
WIP: Scaffolding
Josmithr 4a07c85
refactor: Rename param
Josmithr ac1cbbd
refactor: Remove unneeded use of `any`
Josmithr 270401c
WIP: Implement event pausing
Josmithr d694730
WIP: opt into event deferral in table schema transactions
Josmithr 8d3526c
docs: TODO
Josmithr c29a0c8
Merge branch 'main' into tree/deferred-events-during-transactions
Josmithr 9c83f13
test: Add unit tests
Josmithr bdfd345
docs: Fix typo
Josmithr 8c93b42
test: Remove `.only`
Josmithr 1ead4e4
refactor: Unify infra
Josmithr b5a61c4
style: Formatting
Josmithr 724bb05
WIP: support event deferral in TreeNodeKernel
Josmithr 6329538
refactor: Use TreeNodeKernal-level deferral
Josmithr 1d7116d
revert: transaction changes
Josmithr c4e10a4
test(tree): Run TableSchema tests in both hydrated and unhydrated modes
Josmithr cdf9853
refactor: Cleanup disables
Josmithr 2d874a4
Merge branch 'tree/table-test-hydration' into tree/deferred-events-du…
Josmithr 3949ff8
Merge branch 'main' into tree/deferred-events-during-transactions
Josmithr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ import { | |
|
||
import { canInitialize, initialize, initializerFromChunk } from "./schematizeTree.js"; | ||
import type { ITreeCheckout, TreeCheckout } from "./treeCheckout.js"; | ||
import { pauseTreeEvents } from "../simple-tree/index.js"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: revert all these changes |
||
|
||
/** | ||
* Creating multiple tree views from the same checkout is not supported. This slot is used to detect if one already | ||
|
@@ -229,16 +230,10 @@ export class SchematizingSimpleTreeView< | |
return this.flexTreeContext; | ||
} | ||
|
||
/** | ||
* {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransaction} | ||
*/ | ||
public runTransaction<TSuccessValue, TFailureValue>( | ||
transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, | ||
params?: RunTransactionParams, | ||
): TransactionResultExt<TSuccessValue, TFailureValue>; | ||
/** | ||
* {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransaction} | ||
*/ | ||
public runTransaction( | ||
transaction: () => VoidTransactionCallbackStatus | void, | ||
params?: RunTransactionParams, | ||
|
@@ -250,6 +245,8 @@ export class SchematizingSimpleTreeView< | |
| void, | ||
params?: RunTransactionParams, | ||
): TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult { | ||
const { preconditions } = params ?? {}; | ||
|
||
const addConstraints = ( | ||
constraintsOnRevert: boolean, | ||
constraints: readonly TransactionConstraint[] = [], | ||
|
@@ -260,7 +257,7 @@ export class SchematizingSimpleTreeView< | |
this.checkout.transaction.start(); | ||
|
||
// Validate preconditions before running the transaction callback. | ||
addConstraints(false /* constraintsOnRevert */, params?.preconditions); | ||
addConstraints(false /* constraintsOnRevert */, preconditions); | ||
const transactionCallbackStatus = transaction(); | ||
const rollback = transactionCallbackStatus?.rollback; | ||
const value = ( | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
TODO: revert this