bensheldon / good_job

Multithreaded, Postgres-based, Active Job backend for Ruby on Rails.
https://goodjob-demo.herokuapp.com/
MIT License
2.51k stars 189 forks source link

Empty alerts "[]"? #1372

Open andynu opened 3 weeks ago

andynu commented 3 weeks ago

Hi I notice when I have the good_job engine mounted, the status page always shows these two alerts when the page is first loaded.

image

A positive and negative alert with just "[]" as the text.

This is not a problem really, but seems unintentional.

Cheers!

andynu commented 3 weeks ago

Pardon! v3.29.3

bensheldon commented 2 weeks ago

oh that's weird! I wonder if something in your application is converting flash messages to arrays, which isn't untypical: https://stackoverflow.com/a/2452899

I think this code could be made to handle arrays or empty arrays: https://github.com/bensheldon/good_job/blob/ed7bbe33fde7127a85ef1005722a8afa99afe58e/app/views/good_job/shared/_alert.erb#L6

andynu commented 2 weeks ago

Oh, that is definitely what is happening; we commonly use arrays in there. Now that you mention it, it makes sense that it could leak over onto the mounted pages. Since you seem on board, perhaps it could check for blank? there. I'll submit a PR to that effect. Thanks for looking into it!

On Mon, Jun 17, 2024 at 9:44 PM bensheldon @.***> wrote:

oh that's weird! I wonder if something in your application is converting flash messages to arrays, which isn't untypical: https://stackoverflow.com/a/2452899

I think this code could be made to handle arrays or empty arrays: https://github.com/bensheldon/good_job/blob/ed7bbe33fde7127a85ef1005722a8afa99afe58e/app/views/good_job/shared/_alert.erb#L6

— Reply to this email directly, view it on GitHub https://github.com/bensheldon/good_job/issues/1372#issuecomment-2174751496, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAONGMVD5K46V5ZMC5TQJ3ZH6GI3AVCNFSM6AAAAABJGXCXWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUG42TCNBZGY . You are receiving this because you authored the thread.Message ID: @.***>