Clean up types, leave validation in critical path

This commit is contained in:
Eric Bailey
2025-01-07 19:58:50 -06:00
parent 3047644f06
commit 5d15b250c4
+6 -9
View File
@@ -55,16 +55,15 @@ export class FeedViewPostsSlice {
} }
this._feedPost = feedPost this._feedPost = feedPost
this._reactKey = `slice-${post.uri}-${ this._reactKey = `slice-${post.uri}-${
feedPost.reason?.indexedAt || post.indexedAt feedPost.reason && 'indexedAt' in feedPost.reason
? feedPost.reason.indexedAt
: post.indexedAt
}` }`
if (feedPost.post.uri === FALLBACK_MARKER_POST.post.uri) { if (feedPost.post.uri === FALLBACK_MARKER_POST.post.uri) {
this.isFallbackMarker = true this.isFallbackMarker = true
return return
} }
if ( if (!AppBskyFeedPost.isValidRecord(post.record)) {
!AppBskyFeedPost.isRecord(post.record) ||
!AppBskyFeedPost.validateRecord(post.record).success
) {
return return
} }
const parent = reply?.parent const parent = reply?.parent
@@ -94,8 +93,7 @@ export class FeedViewPostsSlice {
} }
if ( if (
!AppBskyFeedDefs.isPostView(parent) || !AppBskyFeedDefs.isPostView(parent) ||
!AppBskyFeedPost.isRecord(parent.record) || !AppBskyFeedPost.isValidRecord(parent.record)
!AppBskyFeedPost.validateRecord(parent.record).success
) { ) {
this.isOrphan = true this.isOrphan = true
return return
@@ -136,8 +134,7 @@ export class FeedViewPostsSlice {
} }
if ( if (
!AppBskyFeedDefs.isPostView(root) || !AppBskyFeedDefs.isPostView(root) ||
!AppBskyFeedPost.isRecord(root.record) || !AppBskyFeedPost.isValidRecord(root.record)
!AppBskyFeedPost.validateRecord(root.record).success
) { ) {
this.isOrphan = true this.isOrphan = true
return return