Cancel All Matchmaker Tickets

Hi All,

I am currently running into an issue with matchmaking tickets. I am occasionally getting an error in which too many matchmaker tickets are being sent up. I have been unable to recreate this issue locally. What I am looking to do instead, is as the players search for a match, their matchmaking tickets will be cancelled before the new one is sent up (current setup is that only one matchmaker ticket is allowed).
At present, I am not storing these tickets anywhere as they are being sent up so I am losing the ticketIds. Is there a way to simply cancel all matchmaking on the socket for the player without having a reference to the ticket that they initially sent up? Or will I need to store these before I will be able to remove them?

A second but related question, is if I do need to store these, can I simply store the Ticket.Ticket string as a playerPref, and get the ticket itself back from this string in order to cancel it?

Thanks in advance!Versions: Nakama 3.32.0
Server Framework Runtime language : TS/JS

Hello @cobby363,

There is no dedicated function to cancel all tickets. An alternative would be to disconnect the socket, as this will automatically remove all the associated tickets from the pool, however this may not be your best option for practical reasons, the best is to cache the ticket ids locally as you’ve mentioned.

I don’t see any issue with using PlayerPrefs, although you could just have an in memory mapping that is cleared when a ticket is resolved or a ticket is removed from the pool, as I don’t expect these tickets to be useful between different session since matchmaking depends on the socket being connected.

Best.