Merge pull request 'fix(fishing): avoid stale no-session response on session end' (#9) from myong_dev into main

Reviewed-on: #9
This commit is contained in:
안명현 2026-04-09 04:14:39 +00:00
commit d9f3e160aa
1 changed files with 10 additions and 2 deletions

View File

@ -203,6 +203,13 @@ export class FishingService {
return;
}
if (session.status === 'success' || session.status === 'failed') {
await interaction.update({
components: [this.buildControlRow(session.userId, true)],
});
return;
}
if (interaction.user.id !== session.userId) {
await interaction.reply({
content: t(locale, 'commands.fishing.ownerOnly'),
@ -368,8 +375,6 @@ export class FishingService {
private static async finishSession(session: FishingSession, finalState: 'success' | 'failed', deleteThread: boolean) {
session.status = finalState;
this.clearTick(session);
this.sessionsByUser.delete(this.getUserKey(session.guildId, session.userId));
this.sessionsByThread.delete(session.threadId);
logger.info(`[Fishing] Finished session for ${session.userId} with state ${finalState}.`);
@ -377,6 +382,9 @@ export class FishingService {
await this.renderSession(session, true);
this.sessionsByUser.delete(this.getUserKey(session.guildId, session.userId));
this.sessionsByThread.delete(session.threadId);
if (finalState === 'success') {
await this.sendCatchResult(session);
}