Added debug log for missing post id in embedded permalink (#23790)
* Added stricter checks for accessing other post embed data * Added debug log * Removed unused import * lint fix
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2788c883b0
Коммит
178dbb9f95
@@ -218,6 +218,13 @@ export function handlePosts(state: RelationOneToOne<Post, Post> = {}, action: Ge
|
|||||||
const newEmbeds: PostEmbed[] = [];
|
const newEmbeds: PostEmbed[] = [];
|
||||||
|
|
||||||
for (const embed of otherPost.metadata.embeds) {
|
for (const embed of otherPost.metadata.embeds) {
|
||||||
|
if (embed.type === 'permalink' && embed.data && !('post_id' in embed.data)) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('post_id missing in post embed data for permalink.');
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error(embed.data);
|
||||||
|
}
|
||||||
|
|
||||||
if (embed.type === 'permalink' && (embed.data as PostPreviewMetadata).post_id === post.id) {
|
if (embed.type === 'permalink' && (embed.data as PostPreviewMetadata).post_id === post.id) {
|
||||||
// skip if the embed is the deleted post
|
// skip if the embed is the deleted post
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user