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
9 changes: 9 additions & 0 deletions feeds.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,14 @@
"Articles",
"News"
]
},
{
"name": "claude.dev Blog",
"url": "https://claude.dev/rss.xml",
"tags": [
"Articles",
"Blog",
"claude"
]
}
]
13 changes: 13 additions & 0 deletions src/app/config/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@ describe("app/config/env", () => {
}
});

it("rejects an explicit feed subscription file that does not exist", async () => {
const temporaryDirectory = mkdtempSync(join(tmpdir(), "rss-summary-config-"));
const missingFile = join(temporaryDirectory, "missing-feeds.json");

try {
await expect(Effect.runPromise(loadEnvConfig({ RSS_FEEDS_FILE: missingFile }))).rejects.toThrow(
`Feed subscription file does not exist: ${missingFile}`
);
} finally {
rmSync(temporaryDirectory, { force: true, recursive: true });
}
});

it("allows RSS feed subscriptions from env", async () => {
const config = await resolveConfig(
{
Expand Down
5 changes: 5 additions & 0 deletions src/app/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ function loadFeedSubscriptions(

const feedsFile = configuredFile ?? "feeds.json";
if (!existsSync(feedsFile)) {
// A configured path that is missing means the deployment lost its registry; silently returning
// no subscriptions would turn that into an empty digest that looks like "nothing was published".
if (configuredFile) {
throw new Error(`Feed subscription file does not exist: ${feedsFile}`);
}
return [];
}
return decodeFeedsJson(readFileSync(feedsFile, "utf8"));
Expand Down
Loading