Skip to content

Commit

Permalink
🩹 fix: notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
PsicoThePato authored and steinerkelvin committed Oct 16, 2024
1 parent 841657c commit ffd29da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/commune-worker/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function getApplications(
) {
const dao_entries = await queryDaosEntries(api);
const pending_daos = dao_entries.filter(
(app) => app.status in applicationTypes,
(app) => applicationTypes.includes(app.status),
);
const dao_hash_map: Record<number, DaoApplications> = pending_daos.reduce(
(hashmap, dao) => {
Expand Down
6 changes: 2 additions & 4 deletions apps/commune-worker/src/workers/notify-dao-applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ export async function notifyNewApplicationsWorker(props: WorkerProps) {
if (cid === null) {
console.log(`Failed to parse ${proposal.id} cid`);
} else {
const url = buildIpfsGatewayUrl(cid); // this is wrong
const url = buildIpfsGatewayUrl(cid);
const metadata = await processDaoMetadata(url, proposal.id);
const resolved_metadata = flattenResult(metadata);
// shadowheart
if (resolved_metadata === null) {
console.log(`Failed to get metadata on proposal ${proposal.id}`);
} else {
Expand All @@ -44,7 +43,6 @@ export async function notifyNewApplicationsWorker(props: WorkerProps) {
headers,
})
.then(async function (response) {

Check failure on line 45 in apps/commune-worker/src/workers/notify-dao-applications.ts

View workflow job for this annotation

GitHub Actions / lint

'response' is defined but never used. Allowed unused args must match /^_/u
console.log(response);
await addSeenProposal(seen_proposal);
})
.catch((reason) => console.log(`Reject bc ${reason}`));
Expand All @@ -64,7 +62,7 @@ export async function notifyNewApplicationsWorker(props: WorkerProps) {
(application) => !proposalsSet.has(application.id),
);
const notifications_promises = unseen_proposals.map(pushNotification);
Promise.all(notifications_promises).catch((error) =>
await Promise.all(notifications_promises).catch((error) =>
console.log(`Failed to notify proposal for reason: ${error}`),
);
}

0 comments on commit ffd29da

Please sign in to comment.