Skip to content

Commit

Permalink
chore: add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JayKid committed Feb 24, 2025
1 parent 5543f44 commit 739bc47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/image-alt-text/opportunityHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ export async function syncAltTextSuggestions({ opportunity, newSuggestions, log
const existingSuggestions = await opportunity.getSuggestions();

// eslint-disable-next-line max-len
const ignoredSuggestions = existingSuggestions.filter((s) => s.getStatus() === SuggestionModel.STATUSES.SKIPPED);
const ignoredSuggestions = existingSuggestions.filter((s) => {
log.info(`suggestion data: ${JSON.stringify(s.getData())}`);
log.info(`suggestion status: ${s.getStatus()}`);
return s.getStatus() === SuggestionModel.STATUSES.SKIPPED;
});
log.info(`ignored suggestions: ${JSON.stringify(ignoredSuggestions)}`);
const ignoredSuggestionIds = ignoredSuggestions.map((s) => s.getData().recommendations[0].id);
log.info(`ignored suggestion ids: ${JSON.stringify(ignoredSuggestionIds)}`);

// Remove existing suggestions that were not ignored
await Promise.all(existingSuggestions
Expand Down

0 comments on commit 739bc47

Please sign in to comment.