Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-base: menu item with uci depends doesn't update #6422

Open
wryun opened this issue Jun 8, 2023 · 3 comments · May be fixed by #7058
Open

luci-base: menu item with uci depends doesn't update #6422

wryun opened this issue Jun 8, 2023 · 3 comments · May be fixed by #7058

Comments

@wryun
Copy link
Contributor

wryun commented Jun 8, 2023

Steps to reproduce:

  1. Add a uci dependency to a JSON menu item (e.g. "depends": {"uci": {"system": {"foo": 1}})
  2. Logout and login to LuCI in your browser (to force it to regenerate and cache the new menu).
  3. Modify that configuration option.
  4. Reload the page.

Actual behavior:

The menu won't change due to UCI changes unless you logout (to clear the session) and remove /tmp/luci-indexcache*

Expected behavior:

When saving UCI items from the frontend, the frontend should automatically regenerate the menu.

Additional Information:

Custom build of 22.03.5.

@wryun wryun changed the title luci-base: menu doesn't regenerate on UCI change luci-base: menu item with uci depends doesn't update Jun 8, 2023
@jow-
Copy link
Contributor

jow- commented Jun 8, 2023

Not sure we really want to flush the menu on every single uci change. The menu depends mechanism was not really meant for that level of dynamic usage. Primary use case was masking features (such as hiding wifi or switch config if the relevant sections are not present).

@wryun
Copy link
Contributor Author

wryun commented Jun 8, 2023

I looked into this because we were using it to show log file pages only in certain situations (i.e. when particular options are enabled).

I'd argue that this makes it behave in a less surprising way, the cost of rebuilding the menu is not that high and that uci confirm is already a somewhat slow process. But I can understand that it's less than elegant given that most of the time it wouldn't change.

Alternatively, if the idea is that it should really only be for entire sections, perhaps the individual options dependency support could be removed. Do you see a use case for this when from a user perspective the device has to be rebooted for changes to 'take'?

@jjm2473
Copy link
Contributor

jjm2473 commented Aug 21, 2023

@jow- I have notice that, too. After wifi module auto config, menu not shown "Wireless". Same issue appears on Docker, if I open luci on browser on boot, Docker maybe not start on that time, menu will not show Docker menu even after docker started.
This issue appears on openwrt 23.05.
rm -f /tmp/luci-indexcache* can drop the cache.

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 a pull request may close this issue.

3 participants