Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug: first time add friend #844

Merged
merged 61 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f02e422
new feature: add batch send msg
wangchuxiao-dev Jul 14, 2023
0d406fa
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 14, 2023
e8d9cdc
new feature: add batch send msg
wangchuxiao-dev Jul 14, 2023
691e9f4
new feature: add batch send msg
wangchuxiao-dev Jul 14, 2023
6a1caf5
new feature: add batch send msg
wangchuxiao-dev Jul 14, 2023
cfcc5d8
new feature: add batch send msg
wangchuxiao-dev Jul 14, 2023
3d88daa
new feature: add batch send msg
wangchuxiao-dev Jul 14, 2023
f2bb02d
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 14, 2023
1dbc8fe
fix bug: multiple gateway kick user
wangchuxiao-dev Jul 14, 2023
6bf6a9b
fix bug: multiple gateway kick user
wangchuxiao-dev Jul 14, 2023
afc7efd
fix bug: multiple gateway kick user
wangchuxiao-dev Jul 14, 2023
d92f358
fix bug: multiple gateway kick user
wangchuxiao-dev Jul 14, 2023
fe677ea
fix bug: multiple gateway kick user
wangchuxiao-dev Jul 14, 2023
6c6af61
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 17, 2023
1e1d871
MsgDestructTime
wangchuxiao-dev Jul 17, 2023
541f8f1
fix bug: msg destruct sql
wangchuxiao-dev Jul 17, 2023
25fe972
fix bug: msg destruct
wangchuxiao-dev Jul 17, 2023
2132024
fix bug: msg destruct
wangchuxiao-dev Jul 17, 2023
5cf8fe5
fix bug: msg destruct sql
wangchuxiao-dev Jul 17, 2023
1e156b0
fix bug: msg destruct sql
wangchuxiao-dev Jul 17, 2023
3064274
fix bug: msg destruct sql
wangchuxiao-dev Jul 17, 2023
07c7a36
fix bug: msg destruct sql
wangchuxiao-dev Jul 18, 2023
2d35036
debug: print stack
wangchuxiao-dev Jul 18, 2023
ed1747a
debug: print stack
wangchuxiao-dev Jul 18, 2023
bae93ae
debug: print stack
wangchuxiao-dev Jul 18, 2023
3584d2f
fix bug: msg destruct sql
wangchuxiao-dev Jul 18, 2023
95fd4ba
fix bug: msg notification self 2 self push twice
wangchuxiao-dev Jul 18, 2023
b299da6
fix bug: heartbeat get self notification
wangchuxiao-dev Jul 18, 2023
18f5959
fix bug: init grpc conn in one process
wangchuxiao-dev Jul 19, 2023
d9e1597
fix bug: grpc conn
wangchuxiao-dev Jul 19, 2023
e243c37
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 19, 2023
aba2771
fix bug: zk client recreate node when reconn
wangchuxiao-dev Jul 19, 2023
03486cd
fix bug: set friend mark args error
wangchuxiao-dev Jul 20, 2023
ed9b76b
fix bug: rpc client intercepter called twice
wangchuxiao-dev Jul 21, 2023
f9155b6
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 21, 2023
667dccd
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 24, 2023
e2fca5f
cicd: robot automated Change
wangchuxiao-dev Jul 24, 2023
8762704
test: document msg num set 100
wangchuxiao-dev Jul 24, 2023
d7a9073
Merge branch 'main' of github.com:wangchuxiao-dev/Open-IM-Server
wangchuxiao-dev Jul 24, 2023
79db876
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 25, 2023
f5ed647
new feat: sync designated model
wangchuxiao-dev Jul 25, 2023
b2b6cec
new feat: sync designated model
wangchuxiao-dev Jul 25, 2023
26cb6e4
new feat: sync designated model
wangchuxiao-dev Jul 25, 2023
f6a9876
new feat: sync designated model
wangchuxiao-dev Jul 25, 2023
918ee2e
new feat: sync designated model
wangchuxiao-dev Jul 26, 2023
64ab98f
new feat: sync designated model
wangchuxiao-dev Jul 26, 2023
ba3c8db
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 26, 2023
40c9954
new feat: sync designated model
wangchuxiao-dev Jul 26, 2023
f9af1ee
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Jul 26, 2023
6a72c65
merge code
wangchuxiao-dev Jul 26, 2023
cfb556b
merge code
wangchuxiao-dev Jul 26, 2023
32f9e39
fix bug: repeat add friend not effect
wangchuxiao-dev Jul 27, 2023
88bd75a
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Aug 4, 2023
dad8b40
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Aug 4, 2023
e618854
Merge branch 'main' of github.com:wangchuxiao-dev/Open-IM-Server
wangchuxiao-dev Aug 8, 2023
84d7591
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Aug 10, 2023
4d28d8b
Merge remote-tracking branch 'upstream/main'
wangchuxiao-dev Aug 10, 2023
ec4cfb7
fix bug: refused friend
wangchuxiao-dev Aug 10, 2023
c046f5d
fix bug: fix_add_friend
wangchuxiao-dev Aug 10, 2023
f63f898
fix bug: fix_add_friend
wangchuxiao-dev Aug 10, 2023
aecb563
fix bug: fix_add_friend
wangchuxiao-dev Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/common/db/controller/friend.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func (f *friendDatabase) RefuseFriendRequest(
if fr.HandleResult != 0 {
return errs.ErrArgs.Wrap("the friend request has been processed")
}
log.ZDebug(ctx, "refuse friend request", "friendRequest db", fr, "friendRequest arg", friendRequest)
friendRequest.HandleResult = constant.FriendResponseRefuse
friendRequest.HandleTime = time.Now()
err = f.friendRequest.Update(ctx, friendRequest)
Expand Down
6 changes: 5 additions & 1 deletion pkg/common/db/relation/friend_request_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ func (f *FriendRequestGorm) UpdateByMap(

// 更新记录 (非零值).
func (f *FriendRequestGorm) Update(ctx context.Context, friendRequest *relation.FriendRequestModel) (err error) {
fromUserID := friendRequest.FromUserID
toUserID := friendRequest.ToUserID
friendRequest.FromUserID = ""
friendRequest.ToUserID = ""
return utils.Wrap(
f.db(ctx).
Where("from_user_id = ? AND to_user_id =?", friendRequest.FromUserID, friendRequest.ToUserID).
Where("from_user_id = ? AND to_user_id =?", fromUserID, toUserID).
Updates(friendRequest).
Error,
"",
Expand Down
3 changes: 2 additions & 1 deletion pkg/common/db/relation/meta_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ func NewMetaDB(db *gorm.DB, table any) *MetaDB {
}

func (g *MetaDB) db(ctx context.Context) *gorm.DB {
return g.DB.WithContext(ctx).Model(g.table)
db := g.DB.WithContext(ctx).Model(g.table)
return db
}
Loading