Skip to content

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

Merged
grunch merged 2 commits intomainfrom
issue790-pr1-disable-ghb
Apr 28, 2026
Merged

chore: disable Golden Honey Badger feature (PR1/2)#791
grunch merged 2 commits 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 the "Golden Honey Badger" promotional feature, including special image selection and fee waiver.
    • Removed all related promotional notifications and localized message entries.
  • Updates

    • Standardized order fee calculation—all orders now use uniform pricing logic.
    • Order records and UI no longer track or display the promotional flag.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d8cf1fe6-480e-4ae3-8106-f1e61efde98c

📥 Commits

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

⛔ Files ignored due to path filters (1)
  • images/Honeybadger.png is excluded by !**/*.png
📒 Files selected for processing (18)
  • .env-sample
  • bot/commands.ts
  • bot/messages.ts
  • bot/modules/orders/takeOrder.ts
  • bot/ordersActions.ts
  • locales/de.yaml
  • locales/en.yaml
  • locales/es.yaml
  • locales/fa.yaml
  • locales/fr.yaml
  • locales/it.yaml
  • locales/ko.yaml
  • locales/pt.yaml
  • locales/ru.yaml
  • locales/uk.yaml
  • models/order.ts
  • util/imageCache.ts
  • util/index.ts
💤 Files with no reviewable changes (13)
  • locales/es.yaml
  • locales/ru.yaml
  • locales/fr.yaml
  • locales/fa.yaml
  • locales/uk.yaml
  • models/order.ts
  • locales/de.yaml
  • .env-sample
  • locales/it.yaml
  • locales/pt.yaml
  • bot/messages.ts
  • locales/ko.yaml
  • locales/en.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • bot/modules/orders/takeOrder.ts
  • util/index.ts
  • bot/commands.ts
  • util/imageCache.ts
  • bot/ordersActions.ts

Walkthrough

This PR removes the "Golden Honey Badger" feature: deletes its env var and locale keys, removes image-selection and caching for it, drops the is_golden_honey_badger order field and conditional fee/fee-calculation logic, and updates messaging and command flows accordingly.

Changes

Cohort / File(s) Summary
Configuration
\.env-sample
Removes GOLDEN_HONEY_BADGER_PROBABILITY and its comment.
Image generation & cache
util/imageCache.ts
Removes honeybadger image state and probability-based selection; generateRandomImage now returns only { randomImage }.
Fee calculation util
util/index.ts
Removes isGoldenHoneyBadger parameter from getFee; always returns combined fees (no badger branch).
Order model
models/order.ts
Removes is_golden_honey_badger from IOrder/schema.
Order creation & handling
bot/ordersActions.ts, bot/modules/orders/takeOrder.ts
Stops setting/tracking is_golden_honey_badger; removes conditional fee zeroing and related branches.
Commands / Hold invoice
bot/commands.ts
Always computes hold-invoice amount as Math.floor(order.amount + order.fee); calls simplified getFee.
Messaging
bot/messages.ts
Removes emission of golden_honey_badger message and related boolean flag usage.
Locales
locales/*.yaml (de,en,es,fa,fr,it,ko,pt,ru,uk)
Deletes golden_honey_badger translation key from all locale files.
Misc
util/index.ts, util/imageCache.ts (API changes)
Updates function signatures: getFee(amount, communityId) and generateRandomImage(_nonce)/getStats() now omit honeybadger-related fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • Catrya
  • mostronatorcoder

Poem

🐇 I hopped through code with eager cheer,

The golden badger disappears,
No more special fee or flag,
I nibbled out the extra tag,
Hop, hop — simpler paths appear!

🚥 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 clearly summarizes the main change: disabling the Golden Honey Badger feature across the codebase in the first of three planned PRs.
Linked Issues check ✅ Passed All primary objectives from issue #790 PR 1 are met: feature disabled for new orders, congratulatory messages removed, full fees always charged, environment variable removed, and function signatures updated.
Out of Scope Changes check ✅ Passed All changes are directly aligned with PR 1 objectives to disable the Golden Honey Badger feature; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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

…792)

Final cleanup. Existing documents in MongoDB that still hold
is_golden_honey_badger will simply have the field ignored — no
migration script needed since Mongoose stops casting the field once
it's removed from the schema.

- models/order: drop is_golden_honey_badger from IOrder and schema
- ordersActions / takeOrder: drop is_golden_honey_badger writes
- locales: drop golden_honey_badger key from all 10 languages
- images: delete Honeybadger.png

Closes #790

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@grunch grunch merged commit 41751eb into main Apr 28, 2026
7 checks passed
@grunch grunch deleted the issue790-pr1-disable-ghb branch April 28, 2026 17: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.

Remove Golden Honey Badger feature

2 participants