Skip to content

Sale notice without a price, sale year near New Year - #5

Merged
SusieeTheLinuxUser merged 1 commit into
devfrom
fix/sale-notice-and-year
Nov 6, 2026
Merged

SusieeTheLinuxUser merged 1 commit into
devfrom
fix/sale-notice-and-year

Conversation

@SusieeTheLinuxUser

@SusieeTheLinuxUser SusieeTheLinuxUser commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Found in a read-only bug hunt by GLM 5.3; checked in the code by Claude before fixing.

Fixes

  • main.rs wishlist_notice: a single-game sale notice built its body with formatted.unwrap_or_default(), so a price without a formatted string (Steam's formatted_final_price and Epic's fmtPrice.discountPrice are both optional) gave "50% off — now on Steam". It now says "50% off on Steam". No $ is invented, since Epic prices may not be in USD.
  • app.js saleDateLabel: it compared the date's UTC year with now's local year. Near New Year outside UTC, one end of a sale range showed the year and the other didn't. It now uses now.getUTCFullYear().

Checks

  • cargo test: 158 passed, including a new wishlist_notice test for both cases.
  • node tools/preview/selfcheck.mjs: passes. The new Auckland New Year assert fails without the app.js fix.
  • cargo clippy: no warnings.

Skipped from the same hunt: a network error while checking whether a Steam profile is private shows "Wishlist is empty" until the next poll. That's transient, and guessing a privacy state on error isn't better.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Sale-date labels now show the correct year for dates near New Year, including when the viewer’s timezone differs.
    • Wishlist discount notices now remain readable when a price is unavailable. When a formatted price is available, it continues to appear alongside the discount and store.

- A one-game wishlist sale notice no longer prints "now  on" when the
  store sent no formatted price; it names the store only.
- Sale date labels compare against now's UTC year, so the year shows
  consistently around New Year outside UTC.

Co-Authored-By: GLM 5.3 (via OpenRouter) <noreply@z.ai>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-06T23:13:19.417107Z
We couldn’t complete this review. Comment @codex review to try again.
89f2ccc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change makes sale-date year selection use UTC years and adjusts single-item wishlist sale notices to omit the price clause when no formatted price is available.

Changes: Sale Date Label

Layer / File(s) Summary
UTC year comparison
renderer/app.js, tools/preview/selfcheck.mjs
saleDateLabel compares UTC years when deciding whether to include the year. The self-check covers January 1, 2027, when the current instant is December 31, 2026, across tested timezones.

Wishlist Sale Notice

Layer / File(s) Summary
Optional formatted price
src-tauri/src/main.rs
A single-item wishlist notice includes “now [price]” only when a formatted price exists. Tests cover both output forms.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: codex

Merge Risk: Minimal · up to 89f2c

Sale labels use UTC years, and notices omit unavailable prices. No merge-blocking issue was identified.

Architecture risk: Medium · up to 89f2c

The change affects 3 systems.

Changed systems: src-tauri, renderer, tools

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src-tauri (service) was modified; 1 changed file maps to changed impact.
  • observed — renderer (service) was modified; 1 changed file maps to changed impact.
  • observed — tools (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in renderer/app.js: saleDateLabel now compares d.getUTCFullYear() with now.getUTCFullYear() to decide whether to include the year, replacing the comparison against the local year.
  • observed — Modified behavior in src-tauri/src/main.rs: For a single-item wishlist sale, the notice now includes “now [price]” only when a formatted price exists; without one, it reports the discount and store without an empty price or invented amount.
  • observed — Modified behavior in src-tauri/src/main.rs: Added a test asserting that a price-less Epic wishlist item produces a discount-and-store notice, while an item with a formatted price includes that price.
  • observed — Modified behavior in tools/preview/selfcheck.mjs: Adds a sale-date label assertion that checks January 1, 2027, is formatted with the year when now is December 31, 2026, across the tested timezones; a comment states the comparison uses now’s UTC year.

Reliability and maintainability

  • inferred — Risk-relevant change factors for src-tauri: blast_radius_1; direct_dependents_1
Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title describes both fixes: sale notices without a price and sale-date years near New Year.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution failed

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f30b4458-d3b5-4bb0-9d2e-6b9c07ecf8af
Commits

Reviewing files that changed from the base of the PR and between e5c2c7e and 89f2ccc.

Files selected for processing: 3

  • renderer/app.js
  • src-tauri/src/main.rs
  • tools/preview/selfcheck.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@SusieeTheLinuxUser

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@SusieeTheLinuxUser
SusieeTheLinuxUser merged commit 553a9c7 into dev Nov 6, 2026
4 checks passed
@SusieeTheLinuxUser
SusieeTheLinuxUser deleted the fix/sale-notice-and-year branch November 6, 2026 23:29
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.

1 participant