Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dotnet/EcencyApi.Tests/CurationDeskPayloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ public void RosterFeedFiltersFollowThePublicFeedsValueRules()
Assert.Equal("full", kept["window"]!.GetValue<string>());
Assert.Equal("hive-125125", kept["community"]!.GetValue<string>());
Assert.Equal("s:abc.1:25", kept["cursor"]!.GetValue<string>());
// 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<string>());

// 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\"}");
Expand Down
1 change: 1 addition & 0 deletions dotnet/EcencyApi.Tests/CurationDeskQueryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
Expand Down
2 changes: 1 addition & 1 deletion dotnet/EcencyApi/Handlers/PrivateApi.CurationDesk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public static class CurationDeskQuery
public static readonly IReadOnlySet<string> Views =
new HashSet<string> { "queue", "latest", "new-authors", "recommended", "curated", "all" };
public static readonly IReadOnlySet<string> Apps = new HashSet<string> { "all", "ecency", "peakd", "other" };
public static readonly IReadOnlySet<string> Windows = new HashSet<string> { "full", "half", "eighth", "locked", "all" };
public static readonly IReadOnlySet<string> Windows = new HashSet<string> { "12h", "full", "half", "eighth", "locked", "all" };

/// <summary>
/// Emission order of the feed parameters. Fixed so that the memo key and
Expand Down
Loading