Development#95
Merged
Merged
Conversation
…istings Drew-only v1. When a Torn item market scan finds a listing whose single-unit profit (sell to city) exceeds $5,000, a bargain_alerts row opens; the frontend polls and surfaces it as a persistent top-right toast plus an OS-level notification when the tab is hidden. - V1.25 migration adds bargain_alerts with a partial unique index enforcing one active alert per item at the DB layer. - BargainAlertService.EvaluateAsync hooks DatabaseService.ProcessListingsAsync after ReplaceListingsAsync; threshold lives in ProfitThreshold (5_000). - TornMarketsProcessor overrides a new TryGetPriorityQueueItemAsync hook on QueueProcessorBase, interleaving hot items with the normal queue (50/50, bounded by MaxInterleaves). Synthetic queue items bypass the queue-table mutations. - AlertsController + IBargainAlertAuthService gate /api/alerts/* on BargainAlertsConfiguration.AuthorisedPlayerIds — clean seam for the deferred subscriber-ledger extension. - Frontend BargainAlertsProvider polls /api/alerts/active every 12s (always-on so backgrounded tabs still detect; extra fetch on return-to-visible). Web-Audio chirp when foregrounded; OS notification when hidden. Notification permission prompt fires on first user gesture after authorisation succeeds. ToS / payment-gating extension is deferred — see TODO.md for the analysis. Plan + verification SQL in context/plans/. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: feda54a99c
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review surfaced two issues with the bargain-alerts MR: 1. RunWorkerAsync's `continue` after priority work jumped past the per-worker rate-limit delay, so the alternating snipe-loop drove call volume to roughly 2x the configured budget. Restructured so priority work still skips the queue-table mutations (no DB row to increment / remove against) but falls through to the common delay block at the bottom of the loop. 2. ProcessListingsAsync only evaluated bargain alerts inside the `hasMarketChanged || hasMinimumPriceChanged` branch, so the first-scan-of-an-item path (CreateListingsAsync) and the no-listings-returned early-return path skipped evaluation. Result: bargains present on the first scan never opened, and alerts whose listings disappeared entirely never expired. Now evaluates on every reachable path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…into development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.