yetanalytics/lrs

LRS ignores attachment multipart parts with duplicate SHAs

milt opened this issue · 0 comments

milt commented

Multiparts are made into a map, as can be seen here: https://github.com/yetanalytics/lrs/blob/master/src/main/com/yetanalytics/lrs/pedestal/interceptor/xapi/statements/attachment.cljc#L164-L172

(defn multipart-map
  "Given a list of multiparts, make a map of them by xapi hash"
  [multiparts]
  (reduce (fn [m {:keys [headers] :as multipart}]
            (assoc m
                   (get headers "X-Experience-API-Hash")
                   multipart))
          {}
          multiparts))

Meaning dups are ignored. Instead, make it a map with vector vals a la group-by and reduce over the statements + attachments, pairing as we go.