Lex refactor fixes (#368)
* Fix: handle validation failures correctly in feed-view * Fix: convert the off-spec feed view to lex objects * Fix to fetching all follows during init * Bump @atproto/api@0.2.1 * Fix: properly group together like notifications * 1.12
This commit is contained in:
parent
14965d4d97
commit
cc7b2a246e
9 changed files with 28 additions and 11 deletions
|
@ -5,6 +5,7 @@ import {
|
|||
AppBskyFeedPost,
|
||||
AppBskyFeedGetAuthorFeed as GetAuthorFeed,
|
||||
RichText,
|
||||
jsonToLex,
|
||||
} from '@atproto/api'
|
||||
import AwaitLock from 'await-lock'
|
||||
import {bundleAsync} from 'lib/async/bundle'
|
||||
|
@ -50,12 +51,16 @@ export class FeedItemModel {
|
|||
this.postRecord = this.post.record
|
||||
this.richText = new RichText(this.postRecord, {cleanNewlines: true})
|
||||
} else {
|
||||
this.postRecord = undefined
|
||||
this.richText = undefined
|
||||
rootStore.log.warn(
|
||||
'Received an invalid app.bsky.feed.post record',
|
||||
valid.error,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
this.postRecord = undefined
|
||||
this.richText = undefined
|
||||
rootStore.log.warn(
|
||||
'app.bsky.feed.getTimeline or app.bsky.feed.getAuthorFeed served an unexpected record type',
|
||||
this.post.record,
|
||||
|
@ -634,6 +639,6 @@ async function getGoodStuff(
|
|||
return {
|
||||
success: res.status === 200,
|
||||
headers: resHeaders,
|
||||
data: resBody,
|
||||
data: jsonToLex(resBody),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue