Falco
(Falco)
13 سبتمبر 2022، 3:42م
2
نعم، هذا هو السلوك الذي ينفذه Discourse core منذ عام 2018:
master ← xrav3nz:fix-topic-embed-import-should-update-user
opened 05:14AM - 19 Apr 18 UTC
We ran into a problem where `PollFeed` job didn't update the post author with th… e one found in the RSS feed.
Then I found out `TopicEmbed.import` only updates the post body and neglects new title or author, when a post with the same `embed_url` already exists.
---
Consider the scenario:
1. A blog page with Discourse embedded comment hits `embed_controller#comments`
2. The topic doesn't exist yet, so it tries to fetch the content from RSS feed, but it didn't because feed polling is rate limited
4. It then crawls the webpage and creates a topic with [the default `embed_by_username`](https://github.com/discourse/discourse/blob/ab80986184a498f68d99541c63558ea2089f49d3/lib/topic_retriever.rb#L48)
5. `PollFeed` is schedule to run at a later time, and it fetches the title, content, and author from the RSS feed with [`embed_username_key_from_feed`](https://github.com/discourse/discourse/blob/ab80986184a498f68d99541c63558ea2089f49d3/app/jobs/scheduled/poll_feed.rb#L156).
6. The post should be updated with the title, content and author from the feed.
---
Let me know what you think, cheers! 💪
تم نقل هذه المحادثة إلى موضوع جديد، وجعلها #pr-welcome، إلى إعداد على مستوى المكون الإضافي لتعطيل تحديث المؤلف. سيحتاج شخص ما يرغب في العمل على هذا على الأرجح إلى إضافة معلمة جديدة إلى TopicEmbed.import ثم استخدامها في المكون الإضافي.
4 إعجابات