From 99aa963f8c5293d15f3ba362778aa68d1c3432c6 Mon Sep 17 00:00:00 2001 From: feruzm Date: Mon, 7 Sep 2026 14:09:05 +0000 Subject: [PATCH] Let the 12h curation window through the gateway The desk grows a window=12h band (posts created in the last 12 hours) for curators who work one shift a day. The public feed query builder and the roster-feed body allowlist both key on this set, so without the entry the gateway would drop the value silently and answer with all windows. --- dotnet/EcencyApi.Tests/CurationDeskPayloadTests.cs | 3 +++ dotnet/EcencyApi.Tests/CurationDeskQueryTests.cs | 1 + dotnet/EcencyApi/Handlers/PrivateApi.CurationDesk.cs | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dotnet/EcencyApi.Tests/CurationDeskPayloadTests.cs b/dotnet/EcencyApi.Tests/CurationDeskPayloadTests.cs index 0ce218de..cf05fbbb 100644 --- a/dotnet/EcencyApi.Tests/CurationDeskPayloadTests.cs +++ b/dotnet/EcencyApi.Tests/CurationDeskPayloadTests.cs @@ -349,6 +349,9 @@ public void RosterFeedFiltersFollowThePublicFeedsValueRules() Assert.Equal("full", kept["window"]!.GetValue()); Assert.Equal("hive-125125", kept["community"]!.GetValue()); Assert.Equal("s:abc.1:25", kept["cursor"]!.GetValue()); + // The 12 h band is the newest window; a gateway behind the desk would drop it silently. + var shift = Ok(CurationDeskWrites.RosterFeed, "{\"window\":\"12h\"}"); + Assert.Equal("12h", shift["window"]!.GetValue()); // Trailing newlines and non-ASCII digits are not the value either. var newline = Ok(CurationDeskWrites.RosterFeed, "{\"community\":\"hive-125125\\n\",\"cursor\":\"abc\\n\",\"view\":\"queue\\n\"}"); diff --git a/dotnet/EcencyApi.Tests/CurationDeskQueryTests.cs b/dotnet/EcencyApi.Tests/CurationDeskQueryTests.cs index 78bc8590..8a592b24 100644 --- a/dotnet/EcencyApi.Tests/CurationDeskQueryTests.cs +++ b/dotnet/EcencyApi.Tests/CurationDeskQueryTests.cs @@ -105,6 +105,7 @@ public void EnumsAcceptOnlyTheirAllowlist() Assert.Equal("curation/desk/feed?app=peakd", Feed(("app", "peakd"))); Assert.Equal("curation/desk/feed", Feed(("app", "hive"))); Assert.Equal("curation/desk/feed?window=locked", Feed(("window", "locked"))); + Assert.Equal("curation/desk/feed?window=12h", Feed(("window", "12h"))); Assert.Equal("curation/desk/feed", Feed(("window", "week"))); Assert.Equal("curation/desk/feed", Feed(("sort", "Queue"))); } diff --git a/dotnet/EcencyApi/Handlers/PrivateApi.CurationDesk.cs b/dotnet/EcencyApi/Handlers/PrivateApi.CurationDesk.cs index 04f73aad..1f677d2e 100644 --- a/dotnet/EcencyApi/Handlers/PrivateApi.CurationDesk.cs +++ b/dotnet/EcencyApi/Handlers/PrivateApi.CurationDesk.cs @@ -552,7 +552,7 @@ public static class CurationDeskQuery public static readonly IReadOnlySet Views = new HashSet { "queue", "latest", "new-authors", "recommended", "curated", "all" }; public static readonly IReadOnlySet Apps = new HashSet { "all", "ecency", "peakd", "other" }; - public static readonly IReadOnlySet Windows = new HashSet { "full", "half", "eighth", "locked", "all" }; + public static readonly IReadOnlySet Windows = new HashSet { "12h", "full", "half", "eighth", "locked", "all" }; /// /// Emission order of the feed parameters. Fixed so that the memo key and