Don't forget to lycansubscribe

drop posts with invalid rkeys

Changed files
+6 -6
app
+1 -1
app/importers/base_importer.rb
··· 48 48 49 49 def create_item_for_post(uri) 50 50 post_uri = AT_URI(uri) 51 - return if post_uri.collection != 'app.bsky.feed.post' 51 + return if post_uri.collection != 'app.bsky.feed.post' || post_uri.rkey.length != 13 52 52 53 53 post = Post.find_by( 54 54 user_id: user_id_for_did(post_uri.repo),
+1 -1
app/models/like.rb
··· 8 8 include Searchable 9 9 10 10 validates_presence_of :time, :rkey 11 - validates_length_of :rkey, maximum: 13 11 + validates_length_of :rkey, is: 13 12 12 13 13 validates_presence_of :post_uri, if: -> { post_id.nil? } 14 14
+1 -1
app/models/pin.rb
··· 8 8 include Searchable 9 9 10 10 validates_presence_of :time, :rkey 11 - validates_length_of :rkey, maximum: 13 11 + validates_length_of :rkey, is: 13 12 12 validates :pin_text, length: { minimum: 0, maximum: 1000, allow_nil: false } 13 13 14 14 validates_presence_of :post_uri, if: -> { post_id.nil? }
+1 -1
app/models/post.rb
··· 6 6 validates_presence_of :time, :data, :rkey 7 7 validates :text, length: { minimum: 0, allow_nil: false } 8 8 9 - validates_length_of :rkey, maximum: 13 9 + validates_length_of :rkey, is: 13 10 10 validates_length_of :text, maximum: 1000 11 11 validates_length_of :data, maximum: 10000 12 12
+1 -1
app/models/quote.rb
··· 8 8 include Searchable 9 9 10 10 validates_presence_of :time, :rkey 11 - validates_length_of :rkey, maximum: 13 11 + validates_length_of :rkey, is: 13 12 12 validates :quote_text, length: { minimum: 0, maximum: 1000, allow_nil: false } 13 13 14 14 validates_presence_of :post_uri, if: -> { post_id.nil? }
+1 -1
app/models/repost.rb
··· 8 8 include Searchable 9 9 10 10 validates_presence_of :time, :rkey 11 - validates_length_of :rkey, maximum: 13 11 + validates_length_of :rkey, is: 13 12 12 13 13 validates_presence_of :post_uri, if: -> { post_id.nil? } 14 14