()
| 43 | const feedTypeWebsocket = "websocket" |
| 44 | |
| 45 | func (h *handler) handleRevsDiff() error { |
| 46 | var input map[string][]string |
| 47 | err := h.readJSONInto(&input) |
| 48 | if err != nil { |
| 49 | return err |
| 50 | } |
| 51 | |
| 52 | _, _ = h.response.Write([]byte("{")) |
| 53 | first := true |
| 54 | for docid, revs := range input { |
| 55 | missing, possible := h.collection.RevDiff(h.ctx(), docid, revs) |
| 56 | if missing != nil { |
| 57 | docOutput := map[string]interface{}{"missing": missing} |
| 58 | if possible != nil { |
| 59 | docOutput["possible_ancestors"] = possible |
| 60 | } |
| 61 | if !first { |
| 62 | _, _ = h.response.Write([]byte(",\n")) |
| 63 | } |
| 64 | first = false |
| 65 | _, _ = h.response.Write([]byte(fmt.Sprintf("%q:", docid))) |
| 66 | err = h.addJSON(docOutput) |
| 67 | if err != nil { |
| 68 | return err |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | _, _ = h.response.Write([]byte("}")) |
| 73 | return nil |
| 74 | } |
| 75 | |
| 76 | // UpdateChangesOptionsFromQuery handles any changes POST requests that send parameters in the POST body AND in the query string. If any parameters |
| 77 | // are present in the query string, they override the values sent in the body. |
nothing calls this directly
no test coverage detected