diff --git a/Plugins/RynthCore.Plugin.RynthDreamWeave/DreamWeave/WebLauncher.cs b/Plugins/RynthCore.Plugin.RynthDreamWeave/DreamWeave/WebLauncher.cs index 422370a..42a87e0 100644 --- a/Plugins/RynthCore.Plugin.RynthDreamWeave/DreamWeave/WebLauncher.cs +++ b/Plugins/RynthCore.Plugin.RynthDreamWeave/DreamWeave/WebLauncher.cs @@ -88,6 +88,7 @@ internal sealed class WebLauncher Status = p.Label + ": DreamWeave said: " + message; return LaunchLine.Refused; } + /// The pending destination once, at or after Begin + ReplyTimeoutMs; null otherwise. public WebDestination? TakeTimedOut(long nowMs) { diff --git a/Tools/RynthServerPack.Tests/DreamWeaveWebTests.cs b/Tools/RynthServerPack.Tests/DreamWeaveWebTests.cs index 08d4c84..3fb1378 100644 --- a/Tools/RynthServerPack.Tests/DreamWeaveWebTests.cs +++ b/Tools/RynthServerPack.Tests/DreamWeaveWebTests.cs @@ -324,7 +324,7 @@ internal static class DreamWeaveWebTests var n = new WebLauncher(); Check.True(n.OnChatLine(Line, 0x05, 10_500, out _, out _, out _) == LaunchLine.NotOurs, "no Begin ever: not ours"); - // A consumed request leaves no stale window. + // A consumed request's window persists: a repeat is eaten. var c = new WebLauncher(); c.Begin(Market, 0); c.OnChatLine(Line, 0x05, 100, out _, out _, out _); @@ -339,6 +339,13 @@ internal static class DreamWeaveWebTests Check.True(b.OnChatLine(Line, 0x05, 20_100, out _, out _, out _) == LaunchLine.Code, "new request takes the code while pending"); Check.True(b.OnChatLine(Line, 0x05, 20_200, out _, out _, out _) == LaunchLine.Stale, "then a further valid code is stale"); + // A refused Begin does not extend the stale window. + var t = new WebLauncher(); + t.Begin(Market, 0); + t.Cancel("send failed"); // Pending would answer Busy; TooSoon needs a free slot + Check.True(t.Begin(Market, 2_999) == LaunchBegin.TooSoon, "second begin inside the throttle is refused"); + Check.True(t.OnChatLine(Line, 0x05, 70_000, out _, out _, out _) == LaunchLine.NotOurs, "a refused Begin leaves the window anchored at the first"); + // Window upper boundary. Check.Eq(LaunchWire.CodeLifetimeMs, 60_000L, "code lifetime"); var u = new WebLauncher();