Plots2: Comment Error Message appears on another page

Created on 10 May 2020  路  12Comments  路  Source: publiclab/plots2

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

bug hackoctoberfest

Most helpful comment

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

All 12 comments

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

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

Thanks for reporting this @jscastanos

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

Hi, I would like to work on this issue 馃槉

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!!

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

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!!

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

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

@urvashigupta7 go ahead. Thanks

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SidharthBansal picture SidharthBansal  路  142Comments

gautamig54 picture gautamig54  路  84Comments

CleverFool77 picture CleverFool77  路  73Comments

cesswairimu picture cesswairimu  路  115Comments

SidharthBansal picture SidharthBansal  路  116Comments