discourse/app
Blake Erickson 35e17ce115
FIX: Email Send post has already been taken error (#16992)
* FIX: Email Send post has already been taken error

Adding a failing test first before coming up with a good solution.

Related: 357011eb3b

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
2022-06-06 13:13:26 -06:00
..
assets DEV: Remove unused wizard code (#17016) 2022-06-06 21:01:47 +02:00
controllers SECURITY: Remove auto approval when redeeming an invite (#16974) 2022-06-02 16:10:48 +02:00
helpers FIX: Do not use SVGs for twitter:image metadata (#16973) 2022-06-03 09:02:57 +10:00
jobs FIX: Skip pulling hotlinked images for nil user bio (#16901) 2022-05-24 11:52:13 +01:00
mailers FIX: respect user timezone in emails about silencing and suspending (#16918) 2022-05-27 13:58:54 +04:00
models FIX: Email Send post has already been taken error (#16992) 2022-06-06 13:13:26 -06:00
serializers DEV: Add choices only to relevant wizard fields (#16993) 2022-06-06 15:22:44 +08:00
services FIX: fallback to default push notification icon if none exists (#16961) 2022-06-01 12:00:05 +10:00
views FEATURE: Promote polymorphic bookmarks to default and migrate (#16729) 2022-05-23 10:07:15 +10:00