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

Fix favourite notification without status #10043

Conversation

rinsuki
Copy link
Contributor

@rinsuki rinsuki commented Feb 14, 2019

Fix this.
image

close imas#63 and maybe fix #2865

@@ -14,10 +14,12 @@ def call(account, status)

return favourite unless favourite.nil?

favourite = Favourite.create!(account: account, status: status)
Favourite.transaction do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In NotifyService, we have a check if the activity still exists, I believe it serves the same purpose as wrapping it in a transaction. It should be noted that putting more code into a transaction is not great for performance. ReblogService uses an async worker for NotifyService, and for consistency it might make sense to do the same here instead of using a transaction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not answering for a long time.
I tried to do the same thing with async worker several times, but it didn't work.
I think this issue is a timing issue as shown in the image below.
image

I believe this issue can only be resolved by either:

  • Combine favorite creation process and notification creation process into one transaction to prevent users from deleting favorites until notification is created
  • Add a foreign key constraint on the database side, and fail to insert notification to deleted favorites

And the latter method requires a (potentially large) migration to the notifications table, which can take a long time on a large instance.

Therefore, I think that the former method has no choice but to solve.

Please let me know if there is anything I missed.

@stale
Copy link

stale bot commented Oct 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/wontfix This will not be worked on label Oct 26, 2019
@stale stale bot removed the status/wontfix This will not be worked on label Oct 26, 2019
@stale
Copy link

stale bot commented Feb 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/wontfix This will not be worked on label Feb 23, 2020
@SuperSandro2000
Copy link
Contributor

bump

@stale stale bot removed the status/wontfix This will not be worked on label Feb 23, 2020
@stale
Copy link

stale bot commented Jun 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/wontfix This will not be worked on label Jun 22, 2020
@SuperSandro2000
Copy link
Contributor

/unstale

@stale stale bot removed the status/wontfix This will not be worked on label Jun 22, 2020
@stale
Copy link

stale bot commented Oct 21, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/wontfix This will not be worked on label Oct 21, 2020
@stale stale bot closed this Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/wontfix This will not be worked on
Projects
None yet
3 participants