anchor.diff:                        :cid (gethash "cid" sync-item)
                         :action (gethash "action" sync-item))
                   present-items)))
  +    ;; define our finalizing function. this is needed because sometimes we'll
  +    ;; call out to the DB to pull out present items, sometimes we won't, and
  +    ;; since we're dealing with async, we define a function to handle both
  +    ;; instances
       (flet ((finish (items)
                (let* ((index (make-hash-table :test #'equal))
                       (synced-items nil))
  
positive.code: (defafun link-sync-items (future) (sync-items link-table)
    "Given an array of items pulled from the `sync` table and a string table name
     to link the items against, populate the sync items with their linked counter
     parts (including the sync_id field for each sync item)."
    ;; split up the items by deleted (ie, nother to link against, so we return a
    ;; "fake" record with deleted=true) or present (in which can we grab the
    ;; present items from the link-table and return them with their sync-id
    ;; set). this gives us a completed picture of what's been changed and/or
    ;; deleted.
    (let ((deleted-items nil)
          (present-items nil))
      (loop for sync-item across sync-items do
        (if (string= (gethash "action" sync-item) "delete")
            ;; create a return-ready "deleted" record
            (let ((hash (make-hash-table :test #'equal))
                  (sync-hash (make-hash-table :test #'equal)))
              (setf (gethash "id" sync-hash) (gethash "id" sync-item)
  
negative.code:     (r:disconnect sock)
      (finish future t)))
  
  ;;; ----------------------------------------------------------------------------
  ;;; next up: old sync functions (ie `mod` + `deleted` field based syncing)
  ;;; ----------------------------------------------------------------------------
  