-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix notifications when the projects or users are deleted #4904
Comments
Hi @tachyons I am interested in work on this issue. |
HI @tachyons , If I am not wrong, the notification is triggered from the below piece of code def fork(user)
forked_project = dup
forked_project.build_project_datum.data = project_datum&.data
forked_project.circuit_preview.attach(circuit_preview.blob)
forked_project.image_preview = image_preview
forked_project.update!(
view: 1, author_id: user.id, forked_project_id: id, name: name
)
@project = Project.find(id)
if @project.author != user # rubocop:disable Style/IfUnlessModifier
ForkNotification.with(user: user, project: @project).deliver_later(@project.author)
end
forked_project
end Since, |
@Harry-kp Issue happens when the project or user id deleted after the notification record is created. So that code snippet is fine. |
@tachyons Understood. Let me know if it would be okay for me to work on this issue as it has been already assigned. |
You can pair with Malavi
…On Sun, 21 Apr, 2024, 2:13 pm Harshit Chaudhary, ***@***.***> wrote:
@tachyons <https://github.com/tachyons> Understood. Let me know if it
would be okay for me to work on this issue as it has been already assigned.
—
Reply to this email directly, view it on GitHub
<#4904 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXYAEGJRPOAIAHSY5AL2DTY6N34LAVCNFSM6AAAAABGQTRBNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXHE3DEOJRGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
can you give me steps to reproduce this issue? |
I also want to work on this issue |
@Asrani-Aman Malavi and Harry are already assigned |
When a project is forked, a notification is generated. But if that project is deleted, error is displayed since the notification unable to find the notification.
Solution:
Use null object pattern
Ref:
The text was updated successfully, but these errors were encountered: