RebaseManager Class @beta
Manages the process of merging and rebasing local changes (transactions) in a BriefcaseDb.
The RebaseManager coordinates the rebase of local transactions when pulling and merging changes from other sources,
such as remote repositories or other users. It manages the rebase workflow, including resuming or aborting rebases,
invoking a custom RebaseHandler for each rebased transaction, and tracking the current merge/rebase state.
Key responsibilities:
- Orchestrates the rebase of local transactions after a pull/merge operation.
- Provides methods to check the current merge/rebase state.
- Raises events before and after each transaction is rebased.
- Ensures changes are saved or aborted appropriately based on the outcome of the rebase process.
Obtain the instance for a briefcase via rebaser.
Methods
| Name | Description | |
|---|---|---|
| abort(): Promise<void> | Aborts the in-progress pull/merge, restoring the briefcase to the state it was in before the pull began, | |
| canAbort(): boolean | Determines whether the in-progress pull/merge can be rolled back via RebaseManager.abort. | |
| dispose(): void | Disposes of this RebaseManager, clearing all event listeners. | |
| inProgress(): boolean | Determines whether a pull/merge is currently in progress. | |
| resume(): Promise<void> | Resumes the rebase process for the current iModel, applying any pending local changes | |
| setCustomHandler(handler: RebaseHandler): void | Sets the RebaseHandler invoked for each local transaction while it is rebased during a pull/merge. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| isAborting Accessor ReadOnly | boolean | Indicates whether RebaseManager.abort is currently rolling back a pull/merge. | |
| isMerging Accessor ReadOnly | boolean | Indicates whether the pull/merge is in the merging stage, in which incoming changesets are being applied. | |
| isRebasing Accessor ReadOnly | boolean | Indicates whether the pull/merge is in the rebasing stage, in which local transactions are being reinstated | |
| onApplyIncomingChangesBegin Readonly | BeEvent<(changesets: ChangesetProps[]) => void> | Event raised before applying incoming changes. | |
| onApplyIncomingChangesEnd Readonly | BeEvent<(changes: ChangesetProps[]) => void> | Event raised after applying incoming changes. | |
| onDownloadChangesetsBegin Readonly | BeEvent<() => void> | Event raised before downloading changesets. | |
| onDownloadChangesetsEnd Readonly | BeEvent<() => void> | Event raised after downloading changesets. | |
| onPullMergeBegin Readonly | BeEvent<(changeset: ChangesetIdWithIndex) => void> | Event raised before pull merge process begins. | |
| onPullMergeEnd Readonly | BeEvent<(changeset: ChangesetIdWithIndex) => void> | Event raised after pull merge process ends. | |
| onRebaseBegin Readonly | BeEvent<(txns: TxnProps[]) => void> | Event raised before a rebase operation begins. | |
| onRebaseEnd Readonly | BeEvent<(txns: TxnProps[]) => void> | Event raised after a rebase operation ends. | |
| onRebaseTxnBegin Readonly | BeEvent<(txnProps: TxnProps) => void> | Event raised before a transaction is rebased. | |
| onRebaseTxnEnd Readonly | BeEvent<(txnProps: TxnProps) => void> | Event raised after a transaction is rebased. | |
| onReverseLocalChangesBegin Readonly | BeEvent<() => void> | Event raised before reversing local changes. | |
| onReverseLocalChangesEnd Readonly | BeEvent<(txns: TxnProps[]) => void> | Event raised after reversing local changes. |
Defined in
- backend/src/TxnManager.ts Line 390
Last Updated: 05 November, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.