Skip to content

fix: log bounty fetch failures#825

Open
akshualy wants to merge 2 commits intoWFCD:masterfrom
akshualy:do-not-swallow-errors
Open

fix: log bounty fetch failures#825
akshualy wants to merge 2 commits intoWFCD:masterfrom
akshualy:do-not-swallow-errors

Conversation

@akshualy
Copy link
Copy Markdown

@akshualy akshualy commented Apr 10, 2026

What did you fix?

references #821

Technically this does not fix anything, just helps provide more insight into what's going wrong with bounty rewards in the world state.


Reproduction steps

  1. Fetch https://api.warframestat.us/pc/
  2. Fetch https://api.warframe.com/cdn/worldState.php
  3. Observe that some bounties of JSON of 1 have the reward ['Pattern Mismatch. Results inaccurate.'].
  4. Parse JSON of 2 locally. Observe that no bounty has the error reward.
  5. This clearly indicates that something is going wrong when fetching the bounty rewards on the remote system.

Evidence/screenshot/link to line

This only adds a debug statement to log errors instead of swallowing them, to help check what the actual issue is.

Considerations

  • Does this contain a new dependency? No
  • Does this introduce opinionated data formatting or manual data entry? No
  • Does this pr include updated data files in a separate commit that can be reverted for a clean code-only pr? No
  • Have I run the linter? Yes (oops)
  • Is is a bug fix, feature request, or enhancement? Help for Bug Fix

Summary by CodeRabbit

  • Bug Fixes
    • Bounty reward fetch failures are no longer silently ignored—errors are now emitted to debug logs to aid troubleshooting.
    • No changes to user-facing behavior or outcomes; diagnostics have been improved without altering visible results.

@akshualy akshualy requested a review from a team as a code owner April 10, 2026 01:00
@akshualy akshualy requested a review from EricSihaoLin April 10, 2026 01:00
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e742843-08bc-4048-806d-7e427f869718

📥 Commits

Reviewing files that changed from the base of the PR and between ae6ec03 and e17a389.

📒 Files selected for processing (1)
  • lib/models/SyndicateJob.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/models/SyndicateJob.ts

📝 Walkthrough

Walkthrough

Updated getBountyRewards in lib/models/SyndicateJob.ts to accept a logger dependency (default console), log fetch errors via logger.debug instead of swallowing them, and updated SyndicateJob.build to pass deps.logger.

Changes

Cohort / File(s) Summary
Syndicate job logic
lib/models/SyndicateJob.ts
getBountyRewards signature now includes logger: Dependency['logger'] = console. Replaced silent .catch(() => {}) with error capture and logger?.debug(...). SyndicateJob.build updated to pass deps.logger.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰
I nibble logs where errors peep,
No silence now, no secrets keep.
A debug hop, a careful trace,
Bright carrots lead me to the place.
Hooray — the failing fetch I keep!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly corresponds to the main change: adding debug logging for bounty fetch failures in getBountyRewards, addressing issue #821.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
lib/models/SyndicateJob.ts (1)

84-90: Include request context in the debug log for faster triage.

This now logs failures (great), but adding i18n and url will make mismatch investigations much easier.

Suggested patch
   .catch((error) => {
     const errorMessage =
       error instanceof Error ? error.message : String(error);
     logger?.debug(
-      `Failed to fetch bounty rewards for ${location}: ${errorMessage}`
+      `Failed to fetch bounty rewards (i18n=${i18n}, location=${location ?? 'unknown'}, url=${url}): ${errorMessage}`
     );
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/models/SyndicateJob.ts` around lines 84 - 90, The debug log in the catch
block that currently logs `location` and `errorMessage` should also include the
request context `i18n` and `url` to aid triage; update the `logger?.debug` call
inside the `.catch` (in SyndicateJob.ts where `errorMessage` is computed) to
include `i18n` and `url` in the log message or structured fields (ensure `i18n`
and `url` are in scope or passed into the surrounding function), keeping
`location` and `errorMessage` intact for full context.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@lib/models/SyndicateJob.ts`:
- Around line 84-90: The debug log in the catch block that currently logs
`location` and `errorMessage` should also include the request context `i18n` and
`url` to aid triage; update the `logger?.debug` call inside the `.catch` (in
SyndicateJob.ts where `errorMessage` is computed) to include `i18n` and `url` in
the log message or structured fields (ensure `i18n` and `url` are in scope or
passed into the surrounding function), keeping `location` and `errorMessage`
intact for full context.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b233ac7a-821e-4f07-aad8-b6148ff1c52d

📥 Commits

Reviewing files that changed from the base of the PR and between 5b52685 and 11a75a2.

📒 Files selected for processing (1)
  • lib/models/SyndicateJob.ts

@TobiTenno TobiTenno force-pushed the do-not-swallow-errors branch from 11a75a2 to ae6ec03 Compare April 14, 2026 04:54
@TobiTenno TobiTenno enabled auto-merge (squash) April 14, 2026 04:54
@TobiTenno TobiTenno force-pushed the do-not-swallow-errors branch from 4b4e39a to e17a389 Compare April 24, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants