Skip to content

fix: deliver the SP cooldown-over message from the map tick, not a detached timer - #2357

Closed
erwan-joly wants to merge 2 commits into
masterfrom
arch/restart-safe-cooldowns
Closed

fix: deliver the SP cooldown-over message from the map tick, not a detached timer#2357
erwan-joly wants to merge 2 commits into
masterfrom
arch/restart-safe-cooldowns

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Architecture-review PR 4, rescoped after review: the SP cooldown is not supposed to survive a disconnect, so the persistence half (LastSp column, migration, login re-arm) is gone. What remains is the part that was genuinely broken:

  • The cooldown-over notification (sayi + sd 0) rode Observable.Timer(...).Subscribe() — a detached fire-and-forget holding a session reference with no lifecycle awareness
  • SpCooldownNotificationService (swept by the map life loop) replaces it: due notifications are delivered on tick, sessions that logged out are dropped instead of raced
  • The magic 30 now lives once as TransformationService.SpCooldownSeconds
  • In-session gate semantics unchanged; nothing persists

Manual checks added to documentation/manual-test-plan.md: notification arrives on time in-game; logging out before the window ends delivers nothing and errors nothing.

Build clean; GameObject.Tests 535/535, PacketHandlers.Tests 413/413.

🤖 Generated with Claude Code

LastSp lived only in the player component, so relogging cleared the
transformation cooldown, and the cooldown-over message rode a detached
fire-and-forget timer. LastSp now persists on Character (nullable
column), login rehydrates it and re-arms the 30s window when it is
still open, and the map life loop sweeps due notifications so a
disconnected session is dropped instead of raced.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 42 minutes.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 525dd526-828c-47a9-8c89-5d9d3abd199d

📥 Commits

Reviewing files that changed from the base of the PR and between a5787ac and 4e11279.

⛔ Files ignored due to path filters (1)
  • src/NosCore.Database/Migrations/20260830103418_AddCharacterLastSp.Designer.cs is excluded by !**/*.Designer.cs
📒 Files selected for processing (13)
  • documentation/manual-test-plan.md
  • src/NosCore.Database/Entities/Character.cs
  • src/NosCore.Database/Migrations/20260830103418_AddCharacterLastSp.cs
  • src/NosCore.Database/Migrations/NosCoreContextModelSnapshot.cs
  • src/NosCore.GameObject/Services/MapInstanceGenerationService/MapInstance.cs
  • src/NosCore.GameObject/Services/MapInstanceGenerationService/MapInstanceGenerationService.cs
  • src/NosCore.GameObject/Services/SaveService/SaveService.cs
  • src/NosCore.GameObject/Services/TransformationService/SpCooldownNotificationService.cs
  • src/NosCore.GameObject/Services/TransformationService/TransformationService.cs
  • src/NosCore.PacketHandlers/CharacterScreen/SelectPacketHandler.cs
  • test/NosCore.GameObject.Tests/Services/TransformationService/TransformationServiceTests.cs
  • test/NosCore.PacketHandlers.Tests/Inventory/SpTransformPacketHandlerTests.cs
  • test/NosCore.Tests.Shared/TestHelpers.cs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@erwan-joly erwan-joly closed this Aug 30, 2026
@erwan-joly erwan-joly changed the title fix: SP cooldown survives relog, its notification survives the session fix: deliver the SP cooldown-over message from the map tick, not a detached timer Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant