snapshot_poker_ui_ux_fix_again_fuckmylife

This commit is contained in:
DeSqBlocki
2026-09-08 21:12:34 +02:00
parent c61e34c241
commit 6342c4569b
4 changed files with 66 additions and 40 deletions
+5 -5
View File
@@ -38,11 +38,11 @@ module.exports = {
game game
); );
return interaction.editReply({ try {
content: "✅ Poker table cancelled. All seated players were cashed out.", await interaction.deleteReply();
embeds: [], } catch {}
components: []
}); return;
} catch (error) { } catch (error) {
return editPokerError(interaction, error); return editPokerError(interaction, error);
} }
+5 -5
View File
@@ -8,10 +8,10 @@ module.exports = {
async execute(interaction) { async execute(interaction) {
await deferPokerReply(interaction); await deferPokerReply(interaction);
return interaction.editReply({ try {
content: "✅ Poker table left open.", await interaction.deleteReply();
embeds: [], } catch {}
components: []
}); return;
} }
}; };
+16 -20
View File
@@ -474,25 +474,9 @@ async function clearCookieOperation(
userId, userId,
operationId operationId
) { ) {
if ( const cookies =
typeof operationId !== getCookieCollection();
"string"
||
!/^[A-Za-z0-9:_-]{1,160}$/.test(
operationId
)
) {
throw new Error(
"INVALID_COOKIE_OPERATION_ID"
);
}
const {
cookies
} =
getCollections();
const result =
await cookies.updateOne( await cookies.updateOne(
{ {
userId userId
@@ -505,8 +489,20 @@ async function clearCookieOperation(
} }
); );
return result.modifiedCount === await cookies.updateOne(
1; {
userId,
appliedCookieOperations: {
$size: 0
}
},
{
$unset: {
appliedCookieOperations:
""
}
}
);
} }
+30
View File
@@ -2426,6 +2426,20 @@ function createPokerService({
) )
); );
/*
* Defensive cleanup for sessions created before
* buy-in markers were cleared immediately after
* durable table membership was committed.
*/
await clearOperationQuietly(
userId,
buyInOperationId(
gameId,
player.sessionId
)
);
if ( if (
nextGame.state === nextGame.state ===
"CLOSED" "CLOSED"
@@ -2532,6 +2546,14 @@ function createPokerService({
player.sessionId player.sessionId
) )
); );
await clearOperationQuietly(
player.userId,
buyInOperationId(
gameId,
player.sessionId
)
);
} }
await deleteGameQuietly( await deleteGameQuietly(
@@ -2794,6 +2816,14 @@ function createPokerService({
) )
); );
await clearOperationQuietly(
player.userId,
buyInOperationId(
game.gameId,
player.sessionId
)
);
const remainingGame = const remainingGame =
await store.getGame( await store.getGame(
game.gameId game.gameId