Skip to content

Commit

Permalink
More detailed diagnostics for feed actions (#1834)
Browse files Browse the repository at this point in the history
These logged stats came up as somewhat misleading while debugging lost
PODs. This PR adds more detail.
  • Loading branch information
artwyman authored Jul 23, 2024
1 parent 4605a8a commit 1890231
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/passport-client/src/dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1069,16 +1069,24 @@ async function doSync(
}
}
console.log("[SYNC] initalized credentialManager", credentialManager);
const actions = await state.subscriptions.pollSubscriptions(
const stats = { nActions: 0, nFeeds: 0 };
const subscriptionActions = await state.subscriptions.pollSubscriptions(
credentialManager,
async (actions) => {
await applyActions(state.pcds, [actions]);
await savePCDs(state.pcds);
await saveSubscriptions(state.subscriptions);
stats.nActions += actions.actions.length;
stats.nFeeds++;
}
);

console.log(`[SYNC] Applied ${actions.length} actions`);
console.log(
`[SYNC] Applied ${stats.nActions} actions from ` +
`${subscriptionActions.length}/${
state.subscriptions.getActiveSubscriptions().length
} feeds`
);
} catch (e) {
console.log(`[SYNC] failed to load issued PCDs, skipping this step`, e);
}
Expand Down

0 comments on commit 1890231

Please sign in to comment.