Skip to content

Players with duplicate friend requests get stuck #448

@francislavoie

Description

@francislavoie
Image

Reported on discord: https://discord.com/channels/688377338576109643/716611038950457393/1393758768994713621

Seems like the problem is here:

return _requests.SingleOrDefault(x => x.Sender == req.Sender && x.Receiver == req.Receiver);

Using SingleOrDefault() is the cause because it only returns successfully if there's zero or one results and failing if there's more. Using FirstOrDefault() could allow recovering more gracefully. See https://stackoverflow.com/a/1256784/846934

Should probably use FirstOrDefault() here and then immediately wipe out any other duplicates that aren't exactly that entry, I guess.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions