fix: prevent background Laya rebuilds during playback
Ensure automatic live projection rebuilds use the algorithmic path so Laya identity batches are not launched during live list playback or background sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -323,14 +323,17 @@ let activeState = null;
|
||||
function startRebuild(database = null, options = {}) {
|
||||
if (activeRebuild) return { alreadyRunning: true, state: activeState, promise: activeRebuild };
|
||||
database ||= defaultDatabase();
|
||||
const mark = options.mark || markProjectionBuilding;
|
||||
const runner = options.runner || rebuildWithSignals;
|
||||
const schedule = options.schedule || setImmediate;
|
||||
const {
|
||||
mark = markProjectionBuilding,
|
||||
runner = rebuildWithSignals,
|
||||
schedule = setImmediate,
|
||||
...rebuildOptions
|
||||
} = options;
|
||||
activeState = mark(database);
|
||||
activeRebuild = new Promise((resolve, reject) => {
|
||||
schedule(() => {
|
||||
Promise.resolve()
|
||||
.then(() => runner(database, { stateAlreadyBuilding: true }))
|
||||
.then(() => runner(database, { ...rebuildOptions, stateAlreadyBuilding: true }))
|
||||
.then(resolve, reject);
|
||||
});
|
||||
}).finally(() => {
|
||||
@ -341,7 +344,7 @@ function startRebuild(database = null, options = {}) {
|
||||
}
|
||||
|
||||
function queueRebuild(database = null) {
|
||||
return startRebuild(database).promise;
|
||||
return startRebuild(database, { mode: 'algo' }).promise;
|
||||
}
|
||||
|
||||
function parseData(value) {
|
||||
|
||||
Reference in New Issue
Block a user