File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
services/libs/integrations/src/integrations/reddit Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ async function recursiveCommentParser(
3434 )
3535
3636 // Each stream has at most 99 children to expand. If there are more, we make more than one stream.
37- for ( const chunk of partition ( comment . children , 99 ) ) {
37+ // Stream identifier has max length of 255 characters, so we need to split the children in chunks of 28.
38+ // 28 * 8 + 22 = 246 < 255
39+ // 8 is a length of chunk_id + ,
40+ // 22 is a length of stream identifier prefix
41+ for ( const chunk of partition ( comment . children , 28 ) ) {
3842 if ( chunk . length > 0 ) {
3943 await ctx . publishStream < IRedditMoreCommentsStreamData > (
4044 `${ RedditStreamType . MORE_COMMENTS } :${ metadata . postId } :${ chunk . join ( ',' ) } ` ,
You can’t perform that action at this time.
0 commit comments