Skip to content

chore: disable Golden Honey Badger feature (PR1/2)#791

Open
grunch wants to merge 1 commit intomainfrom
issue790-pr1-disable-ghb
Open

chore: disable Golden Honey Badger feature (PR1/2)#791
grunch wants to merge 1 commit intomainfrom
issue790-pr1-disable-ghb

Conversation

@grunch
Copy link
Copy Markdown
Member

@grunch grunch commented Apr 27, 2026

Stop assigning the Golden Honey Badger image and zero-fee bypass to new orders, and remove the user-facing congratulatory messages. Existing orders in the database keep working since their fee was already calculated at creation time.

  • imageCache: remove probability check; always return regular image
  • getFee: drop isGoldenHoneyBadger parameter and conditional logic
  • createOrder/takebuy: hard-code is_golden_honey_badger to false
  • messages: remove congratulatory blocks for sell orders and hold invoice
  • showHoldInvoice: always charge full fee
  • .env-sample: drop GOLDEN_HONEY_BADGER_PROBABILITY

Closes #790

Summary by CodeRabbit

  • Removed Features

    • Removed "Golden Honey Badger" promotional feature, including special image selection and associated fee discounts.
    • Removed related special notifications.
  • Updates

    • Standardized order fee calculations across the platform—all orders now use uniform pricing logic instead of conditional promotional pricing.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Walkthrough

This pull request removes the "Golden Honey Badger" feature from the application. The changes eliminate the environment variable, remove conditional logic that generated a special image and fee structure for badger orders, simplify fee calculations, and delete related messaging and image caching code across multiple files.

Changes

Cohort / File(s) Summary
Configuration
.env-sample
Removes the GOLDEN_HONEY_BADGER_PROBABILITY environment variable and its inline documentation.
Image Generation & Caching
util/imageCache.ts
Removes honeybadger image storage and probability-based selection logic; generateRandomImage now always returns isGoldenHoneyBadger: false and selects only from regular images.
Fee Calculation
util/index.ts
Refactors getFee function signature to remove the isGoldenHoneyBadger parameter; eliminates conditional fee branching that returned only communityFee for badger orders.
Order Creation & Management
bot/ordersActions.ts, bot/modules/orders/takeOrder.ts
Removes conditional fee recalculation and zero-fee logic for badger orders; hardcodes is_golden_honey_badger to false for all orders.
Messaging
bot/messages.ts
Removes conditional golden_honey_badger message paths from pendingSellMessage and showHoldInvoiceMessage flows.
Command Display
bot/commands.ts
Simplifies hold invoice amount calculation to uniform floor(order.amount + order.fee) formula; removes badger-specific conditional logic and updates fee function call.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Issue #790: Directly implements the removal of the Golden Honey Badger feature, addressing all the same files and functions involved in the original feature introduction.

Possibly related PRs

  • PR #644: This PR directly reverts the "Golden Honey Badger" feature that was introduced, removing the env var, conditional fee logic, image caching, and related messaging.
  • PR #672: Modifies the same util/imageCache.ts and util/index.ts files; the earlier PR added golden-honeybadger image caching and related flag logic, while this PR removes that behavior.

Suggested reviewers

  • Catrya

Poem

🐰 A badger golden once did reign,
With honeyed fees and special gain,
But now we bid it fond goodbye,
The code runs simpler—do or die!
Hop, hop! The cleanup is complete,
One less condition to delete! 🍯✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title accurately describes the main objective of the changeset: disabling the Golden Honey Badger feature across the codebase as evidenced by all modified files.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue790-pr1-disable-ghb

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 (3)
bot/modules/orders/takeOrder.ts (1)

78-78: Nit: unnecessary await on a synchronous call.

generateRandomImage (util/index.ts L567-571) returns imageCache.generateRandomImage(nonce) synchronously — there's no Promise to await. Mirrors how bot/ordersActions.ts L119 calls it without await. Drop the await for consistency.

♻️ Proposed change
-    const { randomImage } = await generateRandomImage(user._id.toString());
+    const { randomImage } = generateRandomImage(user._id.toString());
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bot/modules/orders/takeOrder.ts` at line 78, generateRandomImage returns
synchronously (calls imageCache.generateRandomImage), so remove the unnecessary
await in bot/modules/orders/takeOrder.ts by changing the destructuring call that
assigns randomImage (currently "const { randomImage } = await
generateRandomImage(user._id.toString());") to a plain synchronous call without
await, mirroring how generateRandomImage is used in bot/ordersActions.ts and
preserving the variable name randomImage.
util/imageCache.ts (1)

50-77: Follow-up: drop the now-static isGoldenHoneyBadger from the return shape.

isGoldenHoneyBadger is hardcoded to false and never reassigned, so callers no longer get any signal from it. Once the consumers (bot/ordersActions.ts, bot/modules/orders/takeOrder.ts, bot/commands.tsmessages.showHoldInvoiceMessage) stop reading the flag, consider trimming this from generateRandomImage's return type so the API truthfully reflects what the function does.

Same applies to cache.honeybadgerImage (lines 10, 17, 116) and the honeybadgerCached field in getStats (line 116) — they're now permanently null/false. Reasonable to defer to PR2/3 or PR3/3, just flagging so it isn't forgotten.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@util/imageCache.ts` around lines 50 - 77, generateRandomImage currently
returns a hardcoded isGoldenHoneyBadger=false and the cache still contains
honeybadgerImage/honeybadgerCached fields that are always null/false; remove the
unused boolean from generateRandomImage's return type and its return value,
delete or deprecate the now-unused cache.honeybadgerImage and honeybadgerCached
usages (references in generateRandomImage, cache initialization and getStats),
and update all callers (e.g., bot/ordersActions.ts,
bot/modules/orders/takeOrder.ts, bot/commands.ts →
messages.showHoldInvoiceMessage) to stop expecting that flag so the function
signature and cache API truthfully reflect current behavior.
bot/ordersActions.ts (1)

48-49: isGoldenHoneyBadger is now unused in buildDescription — consider removing.

BuildDescriptionArguments.isGoldenHoneyBadger (L48) is destructured at L209 but never referenced inside buildDescription, and the only call site (L149) passes a hardcoded false. Dropping the field from the interface, the destructure, and the L149 argument would remove the dead surface area without any behavior change. Fine to defer if PR2/3 will sweep this up.

♻️ Proposed cleanup
 interface BuildDescriptionArguments {
   user: UserDocument;
   type: string;
   amount: number;
   fiatAmount: number[];
   fiatCode: string;
   paymentMethod: string;
   priceMargin: any;
   priceFromAPI: boolean;
   currency: IFiat;
-  isGoldenHoneyBadger?: boolean;
 }
       description: buildDescription(descriptionI18n, {
         user,
         type,
         amount,
         fiatAmount,
         fiatCode,
         paymentMethod,
         priceMargin,
         priceFromAPI,
         currency,
-        isGoldenHoneyBadger: false,
       }),
   {
     user,
     type,
     amount,
     fiatAmount,
     fiatCode,
     paymentMethod,
     priceMargin,
     priceFromAPI,
     currency,
-    isGoldenHoneyBadger,
   }: BuildDescriptionArguments,

Also applies to: 149-149, 209-209

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bot/ordersActions.ts` around lines 48 - 49,
BuildDescriptionArguments.isGoldenHoneyBadger is dead: remove the
isGoldenHoneyBadger property from the BuildDescriptionArguments interface,
remove it from the destructuring in buildDescription (the parameter list where
BuildDescriptionArguments is unpacked), and remove the hardcoded false argument
at the buildDescription call site so the function and its interface no longer
carry that unused flag; after edits, run TypeScript to ensure no other
references remain and adjust any remaining call sites or types that referenced
isGoldenHoneyBadger.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@bot/modules/orders/takeOrder.ts`:
- Line 78: generateRandomImage returns synchronously (calls
imageCache.generateRandomImage), so remove the unnecessary await in
bot/modules/orders/takeOrder.ts by changing the destructuring call that assigns
randomImage (currently "const { randomImage } = await
generateRandomImage(user._id.toString());") to a plain synchronous call without
await, mirroring how generateRandomImage is used in bot/ordersActions.ts and
preserving the variable name randomImage.

In `@bot/ordersActions.ts`:
- Around line 48-49: BuildDescriptionArguments.isGoldenHoneyBadger is dead:
remove the isGoldenHoneyBadger property from the BuildDescriptionArguments
interface, remove it from the destructuring in buildDescription (the parameter
list where BuildDescriptionArguments is unpacked), and remove the hardcoded
false argument at the buildDescription call site so the function and its
interface no longer carry that unused flag; after edits, run TypeScript to
ensure no other references remain and adjust any remaining call sites or types
that referenced isGoldenHoneyBadger.

In `@util/imageCache.ts`:
- Around line 50-77: generateRandomImage currently returns a hardcoded
isGoldenHoneyBadger=false and the cache still contains
honeybadgerImage/honeybadgerCached fields that are always null/false; remove the
unused boolean from generateRandomImage's return type and its return value,
delete or deprecate the now-unused cache.honeybadgerImage and honeybadgerCached
usages (references in generateRandomImage, cache initialization and getStats),
and update all callers (e.g., bot/ordersActions.ts,
bot/modules/orders/takeOrder.ts, bot/commands.ts →
messages.showHoldInvoiceMessage) to stop expecting that flag so the function
signature and cache API truthfully reflect current behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ea79731f-e528-4372-9e3e-39054770ee3c

📥 Commits

Reviewing files that changed from the base of the PR and between 064ded1 and 9898ede.

📒 Files selected for processing (7)
  • .env-sample
  • bot/commands.ts
  • bot/messages.ts
  • bot/modules/orders/takeOrder.ts
  • bot/ordersActions.ts
  • util/imageCache.ts
  • util/index.ts
💤 Files with no reviewable changes (2)
  • .env-sample
  • bot/messages.ts

Stop assigning the Golden Honey Badger image and zero-fee bypass to new
orders, drop the user-facing congratulatory messages, and remove the
type definitions and signatures the feature relied on. Existing orders
in the database keep working since their fee was already calculated at
creation time.

- imageCache: remove probability check, honeybadger cache slot,
  honeybadgerCached stat, and isGoldenHoneyBadger from
  generateRandomImage return
- getFee: drop isGoldenHoneyBadger parameter and conditional logic
- ordersActions: hard-code is_golden_honey_badger to false and drop
  isGoldenHoneyBadger from BuildDescriptionArguments
- takeOrder: hard-code is_golden_honey_badger to false; drop the
  unnecessary await on synchronous generateRandomImage
- messages: drop congratulatory blocks and isGoldenHoneyBadger param
  from showHoldInvoiceMessage
- showHoldInvoice: always charge full fee
- .env-sample: drop GOLDEN_HONEY_BADGER_PROBABILITY

Refs #790

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@grunch grunch force-pushed the issue790-pr1-disable-ghb branch from 9898ede to 648ebd5 Compare April 27, 2026 13:30
@grunch grunch requested a review from Luquitasjeffrey April 27, 2026 13:37
@grunch grunch changed the title chore: disable Golden Honey Badger feature (PR1/3) chore: disable Golden Honey Badger feature (PR1/2) Apr 27, 2026
Copy link
Copy Markdown
Collaborator

@Luquitasjeffrey Luquitasjeffrey left a comment

Choose a reason for hiding this comment

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

tACK

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.

Remove Golden Honey Badger feature

2 participants