Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
user-discovery-bot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archives
user-discovery-bot
Commits
8041f9d9
Commit
8041f9d9
authored
Jan 18, 2022
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
InsertFactTwilio should update columns on conflict
parent
7fc64d3d
No related branches found
No related tags found
4 merge requests
!50
Revert "update deps"
,
!48
Release
,
!43
InsertFactTwilio should update columns on conflict
,
!42
Add username field to users table for raw username
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
storage/udbDb.go
+4
-1
4 additions, 1 deletion
storage/udbDb.go
twilio/fact.go
+1
-1
1 addition, 1 deletion
twilio/fact.go
with
5 additions
and
2 deletions
storage/udbDb.go
+
4
−
1
View file @
8041f9d9
...
...
@@ -92,9 +92,12 @@ func (db *DatabaseImpl) InsertFactTwilio(userID, factHash, signature []byte, fac
}
tf
:=
func
(
tx
*
gorm
.
DB
)
error
{
// TODO: THIS IS A RACE CONDITION
// currently, unverified facts can be overwritten. When registerFact (io/factRegistration.go) is called,
// it searches for VERIFIED facts with the hash on line 53. This means that unverified facts can compete with each other
return
tx
.
Clauses
(
clause
.
OnConflict
{
Columns
:
[]
clause
.
Column
{{
Name
:
"hash"
}},
Do
Update
s
:
clause
.
AssignmentColumns
([]
string
{
"timestamp"
})
,
Update
All
:
true
,
})
.
Create
(
f
)
.
Error
}
...
...
This diff is collapsed.
Click to expand it.
twilio/fact.go
+
1
−
1
View file @
8041f9d9
...
...
@@ -35,8 +35,8 @@ func (m *Manager) RegisterFact(uid *id.ID, fact string, factType uint8, signatur
}
else
{
to
=
fact
channel
=
Email
.
String
()
}
verifyId
,
err
:=
m
.
verifier
.
Verification
(
to
,
channel
)
jww
.
INFO
.
Printf
(
"Sent verification & received %s"
,
verifyId
)
if
err
!=
nil
{
...
...
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