Compare commits

..

No commits in common. "213ccf981c8500edf632440f31a4336bed121bea" and "cc40dfd72797621035e713d12f090a056dc50f6e" have entirely different histories.

3 changed files with 35 additions and 37 deletions

View File

@ -349,7 +349,7 @@ export class Cache extends Feature {
opers.forEach((oper) => {
const { entity, operation } = oper;
this.cacheStore.operate(entity, operation, this.context, {
checkerTypes: ['logical'],
checkerTypes: ['logical'], // 这里不能检查data不然在数据没填完前会有大量异常
dontCollect: true,
});
});

View File

@ -6,7 +6,6 @@ import { judgeRelation } from "oak-domain/lib/store/relation";
import { Feature } from '../types/Feature';
import { generateNewId } from 'oak-domain/lib/utils/uuid';
export const MODI_NEXT_PATH_SUFFIX = ':next';
const START_LSN = 100;
function mergeOperation(schema, entity, oper1, oper2) {
const { action, data } = oper2;
const operMerged = cloneDeep(oper1);
@ -91,7 +90,7 @@ class UpdateLogManager {
constructor(schema, entity, maxLsn) {
this.schema = schema,
this.entity = entity,
this.maxLsn = maxLsn || START_LSN;
this.maxLsn = maxLsn || 0;
}
/**
* 合并两个filter完全一致的更新
@ -166,7 +165,7 @@ class UpdateLogManager {
rollback(lsn) {
const newLogs = this.logs.filter(ele => ele.lsn <= lsn);
this.logs = newLogs;
this.maxLsn = lsn || START_LSN;
this.maxLsn = lsn;
}
makeOperations() {
const opers = {};
@ -1432,7 +1431,7 @@ class SingleNode extends Node {
saveRefreshResult(data) {
const ids = Object.keys(data);
assert(ids.length === 1);
this.setId(ids[0]);
this.id = ids[0];
this.sr = data[ids[0]];
this.passRsToChild();
// this.publish();
@ -1744,7 +1743,7 @@ export class RunningTree extends Feature {
this.nodeCountDict = {};
this.pageNodeStack = {};
this.singletonDict = {};
this.logSerailNumber = START_LSN;
this.logSerailNumber = 100;
}
increaseNodeCount(path) {
if (!this.nodeCountDict[path]) {

View File

@ -15,7 +15,6 @@ import { ActionDef } from '../types/Page';
import { generateNewId } from 'oak-domain/lib/utils/uuid';
export const MODI_NEXT_PATH_SUFFIX = ':next';
const START_LSN = 100;
type LegalOperation<ED extends EntityDict & BaseEntityDict, T extends keyof ED> = ED[T]['CreateSingle']
| ED[T]['Update']
@ -131,7 +130,7 @@ class UpdateLogManager<ED extends EntityDict & BaseEntityDict, T extends keyof E
constructor(schema: StorageSchema<ED>, entity: T, maxLsn?: number) {
this.schema = schema,
this.entity = entity,
this.maxLsn = maxLsn || START_LSN;
this.maxLsn = maxLsn || 0;
}
/**
* filter完全一致的更新
@ -214,7 +213,7 @@ class UpdateLogManager<ED extends EntityDict & BaseEntityDict, T extends keyof E
ele => ele.lsn <= lsn
);
this.logs = newLogs;
this.maxLsn = lsn || START_LSN;
this.maxLsn = lsn;
}
makeOperations() {
@ -1729,7 +1728,7 @@ class SingleNode<ED extends EntityDict & BaseEntityDict,
saveRefreshResult(data: Record<string, any>) {
const ids = Object.keys(data);
assert(ids.length === 1);
this.setId(ids[0]);
this.id = ids[0];
this.sr = data[ids[0]!];
this.passRsToChild();
@ -2108,7 +2107,7 @@ export class RunningTree<ED extends EntityDict & BaseEntityDict> extends Feature
this.nodeCountDict = {};
this.pageNodeStack = {};
this.singletonDict = {};
this.logSerailNumber = START_LSN;
this.logSerailNumber = 100;
}
private increaseNodeCount(path: string) {