Skip to content
Snippets Groups Projects
Commit 3c53d432 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

If the insert fails, due to the duplicate most likely, try to look up the uuid

parent f7350042
No related branches found
No related tags found
2 merge requests!60Revert "Fail a test to be sure it works",!10Make the message id index unique
......@@ -382,7 +382,14 @@ func (w *wasmModel) receiveHelper(newMessage *Message) (uint64,
err = txn.Await(ctx)
cancel()
if err != nil {
return 0, errors.Errorf("Upserting Message failed: %+v", err)
err = errors.Errorf("Upserting Message failed: %+v", err)
msgID := cryptoChannel.MessageID{}
copy(msgID[:], newMessage.MessageID)
uuid, _ := w.msgIDLookup(msgID)
if uuid == 0 {
return uuid, nil
}
return 0, err
}
res, _ := addReq.Result()
uuid := uint64(res.Int())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment