Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: set readonly for incomplete sheet (#3960)

boojack00e033181e79
diff --git a/frontend/src/components/Issue/IssueTaskStatementPanel.vue b/frontend/src/components/Issue/IssueTaskStatementPanel.vue
index 2b2ddad2fe..13278b54f5 100644
--- a/frontend/src/components/Issue/IssueTaskStatementPanel.vue
+++ b/frontend/src/components/Issue/IssueTaskStatementPanel.vue
@@ -543,10 +543,8 @@ const handleUploadLocalFileAsSheet = async (event: Event) => {
payload: {},
});
- // TODO(steven): maybe return the sliced statement from backend?
- const statementSlice = statement.slice(0, 40 * 1024);
updateSheetId(sheet.id);
- updateStatement(statementSlice);
+ updateStatement(sheet.statement);
state.isUploadingFile = false;
if (selectedTask.value) updateEditorHeight();
};
diff --git a/frontend/src/store/modules/sheet.ts b/frontend/src/store/modules/sheet.ts
index 04c1d7382a..42ce1de2e0 100644
--- a/frontend/src/store/modules/sheet.ts
+++ b/frontend/src/store/modules/sheet.ts
@@ -125,6 +125,11 @@ export const useSheetStore = defineStore("sheet", {
return true;
}
+ // Incomplete sheets should be read-only. e.g. 100MB sheet from issue task.
+ if (currentSheet.statement.length !== currentSheet.size) {
+ return true;
+ }
+
// The tab is not saved yet, it is editable.
if (currentSheet.id === UNKNOWN_ID) {
return false;
diff --git a/frontend/src/types/sheet.ts b/frontend/src/types/sheet.ts
index e5483d178f..42b8fe00d6 100644
--- a/frontend/src/types/sheet.ts
+++ b/frontend/src/types/sheet.ts
@@ -55,6 +55,9 @@ export interface Sheet {
starred: boolean;
pinned: boolean;
payload: SheetPayload;
+
+ // The current size of statement in bytes.
+ size: number;
}
export interface SheetUpsert {