FIX: Typo on draft save

FIX: Typo on draft save

diff --git a/app/models/draft.rb b/app/models/draft.rb
index aee066c..4a3ab41 100644
--- a/app/models/draft.rb
+++ b/app/models/draft.rb
@@ -78,7 +78,7 @@ class Draft < ActiveRecord::Base
         # around 2 controller actions calling for draft creation at the exact same time
         # to avoid complex locking and a distributed mutex, since this is so rare, simply add a single retry
         if retry_not_unique
-          set(user, key, sequence, data, owenr, retry_not_unique: false)
+          set(user, key, sequence, data, owner, retry_not_unique: false)
         else
           raise e
         end

GitHub sha: 3f9b310b

1 Like

So it means that this isn’t tested? I guess you know what I’m gonna ask, right? :nerd_face:

pretty much impossible to test this, relies on concurrency issues to happen

1 Like

Yup. Marking it as follow up to be changed to an SQL upsert.

1 Like

Fixed in FIX: Fix a PostgreSQL error when a draft was concurrently created · discourse/discourse@226d81f · GitHub

1 Like