Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The page is not updated after submitting a podcast comment #1788

Closed
lightalloy opened this issue Feb 12, 2019 · 2 comments · Fixed by #1931
Closed

The page is not updated after submitting a podcast comment #1788

lightalloy opened this issue Feb 12, 2019 · 2 comments · Fixed by #1931
Labels
bug always open for contribution external contributors welcome contribution is welcome!

Comments

@lightalloy
Copy link
Contributor

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. Go to a podcast episode page
  2. Fill the comment form
  3. Click submit or press Ctrl+Enter
  4. The "submit" button changes color and the form becomes blurred (as the comment is being submitted).
  5. The form remains the same, the comment doesn't appear on the page.
  6. After refresh, the comment appears on the page.

Expected behavior
After submitting, the comment appears on the page, the comment form returns to its "fresh" state (the submit button changes color back, the textarea is cleared)

Screenshots
podcast_comment

Desktop (please complete the following information):
I've checked in Firefox and Chrome, but suppose that the browser doesn't matter, cause the reason specified below:

Additional context
I've noticed this error in dev environment.

NoMethodError - undefined method `receive_notifications' for #<PodcastEpisode:0x00007fdc223ae340>:
  app/models/notification.rb:50:in `send_new_comment_notifications'
  app/controllers/comments_controller.rb:69:in `create'

So the code needs to be updated to be suitable for the PodcastEpisode comments.

@lightalloy lightalloy added the bug always open for contribution label Feb 12, 2019
@jessleenyc
Copy link
Contributor

Thanks for flagging Anna. @Zhao-Andy is this related to some of the notification work you've been doing?

@jessleenyc jessleenyc added the external contributors welcome contribution is welcome! label Feb 12, 2019
@Zhao-Andy
Copy link
Contributor

Zhao-Andy commented Feb 15, 2019

Ah, this is because the send_new_comment_notifications doesn't handle commenting on podcasts right now. I think that's a discussion we'll want to have later.

For now, a one line guard statement should at least resolve that error:

def send_new_comment_notification(comment)
  return if comment.commentable_type == "PodcastEpisode"
  # rest of the code

Anyone working on this should continue to see if the comment submits and appears properly on the podcast episode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug always open for contribution external contributors welcome contribution is welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants