mirror of
https://github.com/docmost/docmost.git
synced 2026-08-30 02:25:01 +08:00
fix(base): invalidate row cache on base:schema:bumped
This commit is contained in:
@@ -94,6 +94,12 @@ type BaseFormulaRecomputeCompleted = {
|
|||||||
errored: number;
|
errored: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type BaseSchemaBumped = {
|
||||||
|
operation: "base:schema:bumped";
|
||||||
|
pageId: string;
|
||||||
|
schemaVersion: number;
|
||||||
|
};
|
||||||
|
|
||||||
type BaseInboundEvent =
|
type BaseInboundEvent =
|
||||||
| BaseRowCreated
|
| BaseRowCreated
|
||||||
| BaseRowUpdated
|
| BaseRowUpdated
|
||||||
@@ -103,6 +109,7 @@ type BaseInboundEvent =
|
|||||||
| BaseRowsUpdated
|
| BaseRowsUpdated
|
||||||
| BaseFormulaRecomputeStarted
|
| BaseFormulaRecomputeStarted
|
||||||
| BaseFormulaRecomputeCompleted
|
| BaseFormulaRecomputeCompleted
|
||||||
|
| BaseSchemaBumped
|
||||||
| BasePropertyEvent
|
| BasePropertyEvent
|
||||||
| BaseViewEvent
|
| BaseViewEvent
|
||||||
| { operation: string; pageId: string };
|
| { operation: string; pageId: string };
|
||||||
@@ -298,6 +305,14 @@ export function useBaseSocket(pageId: string | undefined): void {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "base:schema:bumped": {
|
||||||
|
// The worker just committed a property type conversion (Path 3) or
|
||||||
|
// a property/cell GC. Invalidate the base + row caches so cells
|
||||||
|
// re-fetch under the new schema.
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["base-rows", pageId] });
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["bases", pageId] });
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "base:formula:recompute:started": {
|
case "base:formula:recompute:started": {
|
||||||
const e = event as BaseFormulaRecomputeStarted;
|
const e = event as BaseFormulaRecomputeStarted;
|
||||||
const store = getDefaultStore();
|
const store = getDefaultStore();
|
||||||
|
|||||||
Reference in New Issue
Block a user