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

Comment Error Message appears on another page #7896

Closed
jscastanos opened this issue May 10, 2020 · 12 comments · Fixed by #8456
Closed

Comment Error Message appears on another page #7896

jscastanos opened this issue May 10, 2020 · 12 comments · Fixed by #8456
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed

Comments

@jscastanos
Copy link
Contributor

Please describe the problem (or idea)

What happened just before the problem occurred? Or what problem could this idea solve?
The error message doesn't behave as it should be.

Steps to produce:

  1. Select any topic and submit an empty comment. (error message should appear that it could not be saved)
  2. Navigate to other pages.
  3. The error message will appear on the page you selected.

output1

NOTE: the bug mention above will not occur if you are going to refresh the page manually. (but it shouldn't be that way)

output2

What did you expect to see that you didn't?
The error message should appear on the page it should be and without any manual action.

Please show us where to look

https://publiclab.org/notes/silentsairam/06-10-2019/an-insight-on-indoor-air-pollutants-factors-sources-pollutants or any related links

What's your PublicLab.org username?

This can help us diagnose the issue:
jec_castanos

Browser, version, and operating system

Many bugs are related to these -- please help us track it down and reproduce what you're seeing!
Chrome - Version 81.0
Windows 10


Thank you!

Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

@jscastanos jscastanos added the bug the issue is regarding one of our programs which faces problems when a certain task is executed label May 10, 2020
@PrakharSharma41
Copy link
Contributor

PrakharSharma41 commented Aug 25, 2020

Hi @jscastanos , I would like to work on this issue.

@jscastanos
Copy link
Contributor Author

@PrakharSharma41 Sure, go ahead. Just don't forget to mention @publiclab/reviewers in your PR

@cesswairimu
Copy link
Collaborator

Thanks for reporting this @jscastanos

@jscastanos
Copy link
Contributor Author

@cesswairimu No problem. I'll try to find some more in my spare time.

@urvashigupta7
Copy link
Contributor

Hi, I would like to work on this issue 😊

@jywarren jywarren changed the title Error Message appears on another page Comment Error Message appears on another page Oct 1, 2020
@jywarren
Copy link
Member

jywarren commented Oct 1, 2020

Hi, we'd love help with this -- but it may be a bit tangled and difficult to figure out. We do have comment error handling for asynchronous comment submissions, but it may require some digging into code at /app/assets/javascript/ to find where that code is and a look at the Rails controller at /app/controllers/comments_controller.rb (i think?) to see why it's not sending back an error that the client-side JavaScript code can receive and display before refreshing the page. Does that make sense?

Thanks!!

@urvashigupta7
Copy link
Contributor

urvashigupta7 commented Oct 2, 2020

Hi @jywarren , what I can see is when we create a new comment successfully it responds with this javascript file and then notyNotification displays notification that comment has been successfully added. However, when we send empty body it falls inside rescue portion which generates a flash and since it is ajax request and the flash is not displayed it gets stored in flash hash and it displays on another page. So, what we can do is we can add response status 400 and remove the flash so that when this ajax request fails this set of code will add notyNotification

@grvsachdeva
Copy link
Member

Nice catch @urvashigupta7. I can see @PrakharSharma41 also claimed this issue. Let's check with them if they have started working on this one? Maybe you both can collaborate to solve this issue. Thanks!!

@urvashigupta7
Copy link
Contributor

Thanks @gauravano 😊. @PrakharSharma41 Are you still working on this?

@urvashigupta7
Copy link
Contributor

Hi @gauravano , @jywarren. Should I open a pull request as Prakhar hasn't replied yet?

@cesswairimu
Copy link
Collaborator

@urvashigupta7 go ahead. Thanks

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Yay, thanks all! Good to see you @gauravano !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants