-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Avoid Raising NoMethodError in chat_channels with other_user is not Present #5792
Comments
@mstruve I would like to work on this issue |
@anubhav8421 go ahead and thank you! |
It is my first time exploring the dev.to codebase. I was able to setup the environment as defined in the documentation. I have read through the honeybadger issue plus details provided by @mstruve . I understood that we should not call So if we just use safety operator in To test and reproduce the issue, please suggest the steps. |
That would probably work, or it might cause other issues when loading the page. I would suggest writing a test to find out. |
hi @anubhav8421, as @mstruve mentioned, the best way to find out for sure is to write a spec about it. As Let me know if you need further info! |
Fixed by preventing a channel from being created for a single user #7773 |
There are times when a ChatChannel is opened via the controller that a
other_user
for that chat channel is not present. This causes the below error to be raised when we try to index that chat channel membership and attempt to fetch thechannel_image
Honeybadger: https://app.honeybadger.io/fault/66984/f79138e2afe22c7a949dc283ec6beec8
Error:
I don't think we should ever be initializing the
ProfileImage
class with a nil resource so one fix might be to add a guard clause to check for that before initializing the class. It appears we have a lot of safety operators (.&
) all over the ChatChannelMembership ActiveRecord model class which would indicate that we don't always expect to find another_user
so this appears to just be a case we forgot to handle.The text was updated successfully, but these errors were encountered: