anchor.diff:                         (nil (r:run sock query)))
                    (finish future keydata))
                  (signal-error future (make-instance 'insufficient-privileges
  -                                                   :msg "Sorry, you are modifying a project you aren't a member of.")))))
  +                                                   :msg "Sorry, you are modifying a project you aren't a member of."))))
            (signal-error future (make-instance 'insufficient-privileges
                                                :msg "Sorry, the persona you are modifying does not exist or you passed the wrong challenge response.")))))
   
  
positive.code:   "Add a persona's key to a project's key data."
    (validate-key (keydata future)
      (aif (persona-challenge-response-valid-p persona-id challenge-response)
           (alet ((perms (get-user-project-permissions user-id project-id)))
             (if (<= 1 perms)
                 (alet* ((sock (db-sock))
                         (sub-query (r:r
                                      ;; if the keys array already contains {a: <persona-id>} ...
                                      (:branch (:contains
  
negative.code:                                                    ;; :default prevents "BAD KEY" errors
                                                     (:default (:attr key "a") nil)))
                                                 persona-id)
                                        ;; key already exists in project, update it
                                        (:append
                                          ;; filter all keys out where key.a == <persona-id>
                                          (:filter
                                            (:row "keys")
                                            (r:fn (k)
                                              (:~ (:&& (:has-fields k "a")
                                                       (:== (:attr k "a") persona-id)))))
                                          `(("a" . ,persona-id)
                                            ("k" . ,keydata)))
                                        ;; this is a new key, add it
                                        (:append
                                          (:row "keys")
                                          `(("a" . ,persona-id)
                                            ("k" . ,keydata))))))
                         ;; main update, takes sub-query above and uses it to
                         ;; update the projects's keys
                         (query (r:r
                                  (:update
                                    (:get (:table "projects") project-id)
  