Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
client
Commits
2ab1835b
Commit
2ab1835b
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
improve hnadling for group messages
parent
02d89aff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!233
Modify restore to call user-defined bindings callback. Add Sent requests to...
,
!231
Revert "Update store to print changes to the partners list"
,
!222
Hotfix/dropped grp message
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
groupChat/receive.go
+13
-3
13 additions, 3 deletions
groupChat/receive.go
network/follow.go
+2
-0
2 additions, 0 deletions
network/follow.go
network/message/garbled.go
+2
-2
2 additions, 2 deletions
network/message/garbled.go
network/rounds/check.go
+2
-2
2 additions, 2 deletions
network/rounds/check.go
with
19 additions
and
7 deletions
groupChat/receive.go
+
13
−
3
View file @
2ab1835b
...
...
@@ -42,11 +42,18 @@ func (m Manager) receive(rawMsgs chan message.Receive, stop *stoppable.Single) {
stop
.
ToStopped
()
return
case
receiveMsg
:=
<-
rawMsgs
:
jww
.
TRACE
.
Print
(
"Group message reception received cMix message."
)
jww
.
DEBUG
.
Printf
(
"Group message reception received cMix message on round %d (%d) sent by %s at %d."
,
receiveMsg
.
RoundId
,
receiveMsg
.
RoundTimestamp
.
Unix
(),
receiveMsg
.
Sender
.
String
(),
receiveMsg
.
Timestamp
.
Unix
())
// If given zero time, try to guesstimate roundTimestamp as right now
if
receiveMsg
.
RoundTimestamp
.
Equal
(
time
.
Unix
(
0
,
0
))
{
jww
.
ERROR
.
Printf
(
"getCryptKey missing roundTimestamp"
)
receiveMsg
.
RoundTimestamp
=
time
.
Now
()
}
// Attempt to read the message
g
,
msgID
,
timestamp
,
senderID
,
msg
,
noFpMatch
,
err
:=
m
.
readMessage
(
receiveMsg
)
g
,
msgID
,
timestamp
,
senderID
,
msg
,
noFpMatch
,
err
:=
m
.
readMessage
(
receiveMsg
)
if
err
!=
nil
{
if
noFpMatch
{
jww
.
TRACE
.
Printf
(
"Received message not for group chat: %+v"
,
...
...
@@ -145,6 +152,9 @@ func (m *Manager) decryptMessage(g gs.Group, cMixMsg format.Message,
messageID
:=
group
.
NewMessageID
(
g
.
ID
,
intlMsg
.
Marshal
())
// Remove from garbled message on success to prevent reprocessing
m
.
store
.
GetGarbledMessages
()
.
Remove
(
cMixMsg
)
return
messageID
,
intlMsg
.
GetTimestamp
(),
senderID
,
intlMsg
.
GetPayload
(),
nil
}
...
...
This diff is collapsed.
Click to expand it.
network/follow.go
+
2
−
0
View file @
2ab1835b
...
...
@@ -374,6 +374,7 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source,
if
!
m
.
param
.
RealtimeOnly
{
roundsWithMessages2
=
identity
.
UR
.
Iterate
(
func
(
rid
id
.
Round
)
bool
{
// TODO add set unchecked
if
gwRoundsState
.
Checked
(
rid
)
{
return
rounds
.
Checker
(
rid
,
filterList
,
identity
.
CR
)
}
...
...
@@ -384,6 +385,7 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source,
for
_
,
rid
:=
range
roundsWithMessages
{
//denote that the round has been looked at in the tracking store
if
identity
.
CR
.
Check
(
rid
)
{
// TODO: Err
m
.
round
.
GetMessagesFromRound
(
rid
,
identity
)
}
}
...
...
This diff is collapsed.
Click to expand it.
network/message/garbled.go
+
2
−
2
View file @
2ab1835b
...
...
@@ -109,11 +109,11 @@ func (m *Manager) handleGarbledMessages() {
MessageType
:
message
.
Raw
,
Sender
:
&
id
.
ID
{},
EphemeralID
:
ephemeral
.
Id
{},
Timestamp
:
time
.
Time
{}
,
Timestamp
:
time
.
Unix
(
0
,
0
)
,
Encryption
:
message
.
None
,
RecipientID
:
&
id
.
ID
{},
RoundId
:
0
,
RoundTimestamp
:
time
.
Time
{}
,
RoundTimestamp
:
time
.
Unix
(
0
,
0
)
,
}
im
:=
fmt
.
Sprintf
(
"[GARBLE] RAW Message reprocessed: keyFP: %v, "
+
"msgDigest: %s"
,
grbldMsg
.
GetKeyFP
(),
grbldMsg
.
Digest
())
...
...
This diff is collapsed.
Click to expand it.
network/rounds/check.go
+
2
−
2
View file @
2ab1835b
...
...
@@ -63,7 +63,7 @@ func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.Iden
jww
.
INFO
.
Printf
(
"Messages found in round %d for %d (%s), looking "
+
"up messages via historical lookup"
,
roundID
,
identity
.
EphId
.
Int64
(),
identity
.
Source
)
//store the round as an unre
tr
eived round
//store the round as an unre
c
eived round
err
=
m
.
Session
.
UncheckedRounds
()
.
AddRound
(
roundID
,
nil
,
identity
.
Source
,
identity
.
EphId
)
if
err
!=
nil
{
...
...
@@ -79,7 +79,7 @@ func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.Iden
jww
.
INFO
.
Printf
(
"Messages found in round %d for %d (%s), looking "
+
"up messages via in ram lookup"
,
roundID
,
identity
.
EphId
.
Int64
(),
identity
.
Source
)
//store the round as an unre
tr
eived round
//store the round as an unre
c
eived round
if
!
m
.
params
.
RealtimeOnly
{
err
=
m
.
Session
.
UncheckedRounds
()
.
AddRound
(
roundID
,
ri
,
identity
.
Source
,
identity
.
EphId
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment