Reliable way to handle a party closing in typescript module

Is there a reliable way to handle a party closing in the typescript module? In our game the user has the option to generate a short party id for easy sharing with friends (or stream viewers). This short party id is stored in the nakama storage engine. I would like to reliably clean up the storage, but I can’t find out how.

I tried to use PartyClose hook. But that only seems to trigger when all players leave the party by sending a leave request. It doesn’t work when a player disconnects.

Hello @RangatangMaarten,

What do you mean exactly with PartyClose hook?

I mean the RtHookMessage that can be used in initializer.registerRtAfter("PartyClose", afterPartyClose) Could I use localcacheGet and localcacheSet to keep track of the party size and perform actions when the let player has left? Or is there a better way?