Skip to content

Commit

Permalink
fix: handle undefined dateString and return LAST_100_CIDS:NONE when n…
Browse files Browse the repository at this point in the history
…o nameOps found

Co-Authored-By: Nico Krause <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and silkroadnomad committed Dec 21, 2024
1 parent 2817207 commit 6bb1fd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion relay/src/pubsubHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ async function handleListRequest(dateString, pageSize, from, filter, orbitdb, he
let nameOps;
console.log("Handling LIST request:", { dateString, pageSize, from, filter });

if (dateString === "LAST") {
if (!dateString || dateString === "LAST") {
nameOps = await getLastNameOps(orbitdb, pageSize, from, filter);
if (nameOps.length === 0) {
publishMessage(helia, "LAST_100_CIDS:NONE", CONTENT_TOPIC);
return;
}
} else {
const date = parseDate(dateString);
if (!date) {
Expand Down

0 comments on commit 6bb1fd5

Please sign in to comment.