Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Merge requests
!10
Make the message id index unique
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Make the message id index unique
hotfix/message_id_unique
into
release
Overview
0
Commits
13
Pipelines
0
Changes
5
Merged
Richard T. Carback III
requested to merge
hotfix/message_id_unique
into
release
2 years ago
Overview
0
Commits
13
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
version 5
version 11
551badd2
2 years ago
version 10
85e5f7e6
2 years ago
version 9
1b8528d5
2 years ago
version 8
5774e53f
2 years ago
version 7
76669d42
2 years ago
version 6
65dd63b8
2 years ago
version 5
8b3910d3
2 years ago
version 4
8266afbb
2 years ago
version 3
3c53d432
2 years ago
version 2
1ee5c9e4
2 years ago
version 1
1ee5c9e4
2 years ago
release (base)
and
version 6
latest version
e83200b0
13 commits,
2 years ago
version 11
551badd2
12 commits,
2 years ago
version 10
85e5f7e6
11 commits,
2 years ago
version 9
1b8528d5
9 commits,
2 years ago
version 8
5774e53f
8 commits,
2 years ago
version 7
76669d42
7 commits,
2 years ago
version 6
65dd63b8
6 commits,
2 years ago
version 5
8b3910d3
5 commits,
2 years ago
version 4
8266afbb
4 commits,
2 years ago
version 3
3c53d432
3 commits,
2 years ago
version 2
1ee5c9e4
1 commit,
2 years ago
version 1
1ee5c9e4
1 commit,
2 years ago
Show latest version
1 file
+
10
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
indexedDb/implementation.go
+
10
−
5
Options
@@ -382,16 +382,21 @@ func (w *wasmModel) receiveHelper(newMessage *Message) (uint64,
err
=
txn
.
Await
(
ctx
)
cancel
()
if
err
!=
nil
{
err
=
errors
.
Errorf
(
"Upserting Message failed: %+v"
,
err
)
return
0
,
errors
.
Errorf
(
"Upserting Message failed: %+v"
,
err
)
}
res
,
err
:=
addReq
.
Result
()
// NOTE: Sometimes the insert fails to return an error but hits
// a duplicate insert, so this fallthrough returns the uuid entry in
// that case.
if
res
.
IsUndefined
()
{
msgID
:=
cryptoChannel
.
MessageID
{}
copy
(
msgID
[
:
],
newMessage
.
MessageID
)
uuid
,
_
:=
w
.
msgIDLookup
(
msgID
)
if
uuid
=
=
0
{
uuid
,
errLookup
:=
w
.
msgIDLookup
(
msgID
)
if
uuid
!
=
0
&&
errLookup
==
nil
{
return
uuid
,
nil
}
return
0
,
err
return
0
,
err
ors
.
Errorf
(
"uuid lookup failure: %+v"
,
err
)
}
res
,
_
:=
addReq
.
Result
()
uuid
:=
uint64
(
res
.
Int
())
jww
.
DEBUG
.
Printf
(
"Successfully stored message from %s, id %d"
,
Loading