mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 21:34:50 +00:00
* FIX: Email Send post has already been taken error Adding a failing test first before coming up with a good solution. Related: 357011eb3b4e9c5fb860a34ecbb2f5cb89e89a7a The above commit changed ``` PostReplyKey.find_or_create_by_safe! ``` to ``` PostReplyKey.create_or_find_by! ``` But I don't think it is working as a 1-1 replacement because of the `Validation failed: Post has already been taken` error we are receiving with this change. Also we need to make sure we don't re-introduce any concurrency issues. Reported: https://meta.discourse.org/t/224706/13 * Remove rails unique constraint and rely on db index I believe this is what is causing `create_or_find_by!` to fail. Because we have a unique constraint in the db I think we can remove this rails unique constraint? * clean up spec wording