Skip to content

Fix feature flags not being disabled when set to false#532

Merged
frenck merged 1 commit into
mainfrom
frenck-2026-0298
Apr 12, 2026
Merged

Fix feature flags not being disabled when set to false#532
frenck merged 1 commit into
mainfrom
frenck-2026-0298

Conversation

@frenck

@frenck frenck commented Apr 12, 2026

Copy link
Copy Markdown
Member

Proposed Changes

Fixes feature flags and toggles not taking effect when disabled in the addon configuration.

Grocy passes feature flag environment variables through to JavaScript, where it evaluates them as booleans. The app was exporting disabled flags as "0", which PHP correctly interprets as falsy but JavaScript evaluates as truthy (non-empty string), causing disabled features to still render as enabled in the UI.

Changed all disable assignments from =0 to ="", empty string is falsy in both PHP and JavaScript.

Related Issues

fixes #490
fixes #461
fixes #518

Summary by CodeRabbit

  • Chores
    • Updated feature flag configuration format for disabled features across the application.

@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label Apr 12, 2026
@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This change modifies the PHP-FPM runtime configuration script to disable Grocy feature flags by assigning empty strings instead of numeric zeros to environment variables. Nineteen feature-related variables are updated, including batteries, calendar, chores, equipment, recipes, shopping list, stock, tasks, and printer options.

Changes

Cohort / File(s) Summary
Environment Variable Value Changes
grocy/rootfs/etc/s6-overlay/s6-rc.d/php-fpm/run
Modified 19 environment variable assignments to use empty string "" instead of 0 for feature flag disablement conditions. Affected variables: GROCY_FEATURE_FLAG_BATTERIES, GROCY_FEATURE_FLAG_CALENDAR, GROCY_FEATURE_FLAG_CHORES, GROCY_FEATURE_FLAG_EQUIPMENT, GROCY_FEATURE_FLAG_RECIPES, GROCY_FEATURE_FLAG_SHOPPINGLIST, GROCY_FEATURE_FLAG_STOCK, GROCY_FEATURE_FLAG_TASKS, GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS, GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS, GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING, GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING, GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING, GROCY_FEATURE_FLAG_STOCK_PRODUCT_FREEZING, GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING, GROCY_FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT, GROCY_LABEL_PRINTER_RUN_SERVER, GROCY_TPRINTER_PRINT_QUANTITY_NAME, GROCY_TPRINTER_PRINT_NOTES.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 From zeros to empty strings we hop,
Feature flags now disabled—no stop!
Chores and calendars, batteries too,
Each variable gets the treatment anew.
Grocy flows cleaner, the clutter's been spanned!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix feature flags not being disabled when set to false' accurately describes the main change in the PR: updating disabled feature flag assignments from '0' to empty string for proper JavaScript evaluation.
Linked Issues check ✅ Passed The PR addresses issue #490 by fixing the underlying cause: disabled flags now export as empty strings that evaluate falsy in JavaScript, allowing the app to properly respect the chores_assignment configuration.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing feature flag evaluation by modifying environment variable assignments for disabled flags. No unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 frenck-2026-0298

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.

@frenck frenck merged commit 9c5cc40 into main Apr 12, 2026
15 checks passed
@frenck frenck deleted the frenck-2026-0298 branch April 12, 2026 13:07
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementors.

Projects

None yet

1 participant