Skip to content

Conversation

@akshayutture-augment
Copy link

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<%= link_to(I18n.t('embed.title'), @topic_view.topic.url, class: 'button', target: '_blank') %>
<%- else %>
<%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %>
<%- end if %>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix invalid ERB block terminator

The new embed view uses <%- end if %> to close the header conditional (line 6). end if is not valid Ruby/ERB syntax, so Rails raises a template compilation error the first time /embed/best is rendered and no HTML is returned. This means the entire embed feature crashes before it can show any posts. Replace the terminator with a normal <%- end %> so the template can render.

Useful? React with 👍 / 👎.

Comment on lines +32 to +36
url = i.link
url = i.id if url.blank? || url !~ /^https?\:\/\//

content = CGI.unescapeHTML(i.content.scrub)
TopicEmbed.import(user, url, i.title, content)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle feeds without content nodes

In Jobs::PollFeed, every item is assumed to have a content field and the code calls i.content.scrub unconditionally. Standard RSS 2.0 feeds only expose a <description> field, so i.content is nil and this line raises NoMethodError: undefined method scrub' for nil:NilClassbefore any topic can be imported. As a result, feed polling fails for the majority of feeds. Guard againstnil(fall back toi.description/i.summaryor skip the entry) before callingscrub` so the job can process real-world feeds.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants