mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 01:52:43 +08:00
fix(base): invalidate row cache on base:schema:bumped
This commit is contained in:
@@ -94,6 +94,12 @@ type BaseFormulaRecomputeCompleted = {
|
||||
errored: number;
|
||||
};
|
||||
|
||||
type BaseSchemaBumped = {
|
||||
operation: "base:schema:bumped";
|
||||
pageId: string;
|
||||
schemaVersion: number;
|
||||
};
|
||||
|
||||
type BaseInboundEvent =
|
||||
| BaseRowCreated
|
||||
| BaseRowUpdated
|
||||
@@ -103,6 +109,7 @@ type BaseInboundEvent =
|
||||
| BaseRowsUpdated
|
||||
| BaseFormulaRecomputeStarted
|
||||
| BaseFormulaRecomputeCompleted
|
||||
| BaseSchemaBumped
|
||||
| BasePropertyEvent
|
||||
| BaseViewEvent
|
||||
| { operation: string; pageId: string };
|
||||
@@ -298,6 +305,14 @@ export function useBaseSocket(pageId: string | undefined): void {
|
||||
}
|
||||
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": {
|
||||
const e = event as BaseFormulaRecomputeStarted;
|
||||
const store = getDefaultStore();
|
||||
|
||||
Reference in New Issue
Block a user