Skip to content

Commit b56c402

Browse files
ENG-1486 - Fix canvas filesize error (#836)
* Add migration to remove null asset file size in discourse relations - Introduced a new migration step to delete the fileSize property from assets of type image or video when its value is null. - Updated migration versioning to include this new step. * Apply 1 edit across 1 file * revert devin --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 9996b49 commit b56c402

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

apps/roam/src/components/canvas/DiscourseRelationShape/discourseRelationMigrations.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
/* eslint-disable @typescript-eslint/no-unsafe-call */
23
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
34
/* eslint-disable @typescript-eslint/no-unsafe-return */
@@ -33,6 +34,7 @@ export const createMigrations = ({
3334
ExtractBindings: 1,
3435
"2.3.0": 2,
3536
AddSizeAndFontFamily: 3,
37+
RemoveNullAssetFileSize: 4,
3638
});
3739
return createMigrationSequence({
3840
sequenceId: `${SEQUENCE_ID_BASE}`,
@@ -143,6 +145,17 @@ export const createMigrations = ({
143145
shape.props.fontFamily = "draw";
144146
},
145147
},
148+
{
149+
id: versions["RemoveNullAssetFileSize"],
150+
scope: "record",
151+
filter: (r: any) =>
152+
r.typeName === "asset" &&
153+
(r.type === "image" || r.type === "video") &&
154+
r.props?.fileSize === null,
155+
up: (asset: any) => {
156+
delete asset.props.fileSize;
157+
},
158+
},
146159
],
147160
});
148161
};

0 commit comments

Comments
 (0)