+8
-2
app/firehose_stream.rb
+8
-2
app/firehose_stream.rb
···
189
189
)
190
190
191
191
if !post.valid?
192
-
log "Error: post is invalid: #{op.uri} (#{msg.seq}): #{post.errors.to_a.join(', ')}"
193
-
return
192
+
if post.errors.has_key?(:data)
193
+
post.trim_too_long_data
194
+
end
195
+
196
+
if !post.valid?
197
+
log "Error: post is invalid: #{op.uri} (#{msg.seq}): #{post.errors.to_a.join(', ')}"
198
+
return
199
+
end
194
200
end
195
201
196
202
matched = false
+14
app/models/post.rb
+14
app/models/post.rb
···
32
32
def at_uri
33
33
"at://#{repo}/app.bsky.feed.post/#{rkey}"
34
34
end
35
+
36
+
def trim_too_long_data
37
+
if embed = record['embed']
38
+
if external = embed['external']
39
+
external['description'] = ''
40
+
end
41
+
end
42
+
43
+
if record['bridgyOriginalText']
44
+
record['bridgyOriginalText'] = ''
45
+
end
46
+
47
+
self.data = JSON.generate(record)
48
+
end
35
49
end