Skip to content

Commit 191f50b

Browse files
authored
Introduce size limit to activity attributes on ingestion (#2737)
1 parent 5fbe21d commit 191f50b

File tree

1 file changed

+7
-0
lines changed
  • services/libs/data-access-layer/src/activities

1 file changed

+7
-0
lines changed

services/libs/data-access-layer/src/activities/ilp.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ function objectToBytes(input: object): string {
213213
input = {}
214214
}
215215

216+
const stringified = JSON.stringify(input)
217+
218+
// check size
219+
if (new TextEncoder().encode(stringified).length > 2000) {
220+
return JSON.stringify({})
221+
}
222+
216223
return JSON.stringify(input)
217224
}
218225

0 commit comments

Comments
 (0)