Skip to content

luci-app-qosify: report an unanswered status call as unknown - #9046

Closed
choppyc79 wants to merge 1 commit into
openwrt:masterfrom
choppyc79:luci-app-qosify-unknown-state
Closed

choppyc79 wants to merge 1 commit into
openwrt:masterfrom
choppyc79:luci-app-qosify-unknown-state

Conversation

@choppyc79

@choppyc79 choppyc79 commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Pull request details

Description

A status call rpcd never answered currently reads as "qosify stopped, not
shaping, init script missing": rpc.declare() without reject: true turns a
ubus error (6 stale ACL, 4 object gone) into the same {} an idle daemon
returns, and L.resolveDefault() cannot tell them apart.

rc.list, service.list and qosify.status are now declared with reject: true,
and the service state is tri-state (true / false / null):

  • Overview: amber Unknown badges, with the cause named once, on the first
    row that reads Unknown
  • Autostart button shows Unknown and is disabled while the state is unknown;
    its click follows the last refresh, not the state at build time
  • Start/stop/restart: if the service.list poll after the call goes
    unanswered, the action fails with "rpcd is not answering"; a stop then
    skips /usr/share/qosify-luci/cleanup instead of cleaning up
  • Save: "shaping could not be checked" instead of a false "not shaping"
  • Save: if service.list goes unanswered while applying, qosify is restarted
    rather than reloaded or started, since the config is already written.
    This also starts a qosify that was stopped
  • Status tab: "rpcd is not answering" instead of "qosify is not running"
  • Config tab: the QoS Enabled badge reads Status Unknown for an enabled
    section while the status call is unanswered, in place of the Enabled —
    Not Shaping / Enabled — Not Running a null active used to fall through
    to. A section disabled in UCI still reads Disabled, since that state
    comes from the config rather than from the call

A stopped qosify still reads as not shaping, since the qosify ubus object
goes with the daemon. No ACL change, no layout change.

Screenshot or video of changes

<Overview: normal / qosify stopped / ACL removed>

Maintainer

@choppyc79


Tested on

OpenWrt version: SNAPSHOT r36237-2ed2c210c3
LuCI version: 26.257.37274~f4eebd4
Web browser(s): Google Chrome


Checklist

  • (Nice to have) Includes what Issue it closes (e.g. openwrt/luci#issue-number).
  • (Nice to have) Includes what it depends on (e.g. openwrt/packages#pr-number in sister repo).

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit.


Generated by Claude Code

Comment thread applications/luci-app-qosify/htdocs/luci-static/resources/view/qosify/main.js Outdated
Comment thread applications/luci-app-qosify/htdocs/luci-static/resources/view/qosify/main.js Outdated
@choppyc79
choppyc79 force-pushed the luci-app-qosify-unknown-state branch from bf30244 to 7253035 Compare September 20, 2026 08:11

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 7253035 "luci-app-qosify: report an unanswered status call as unknown" — the body says the start/stop/restart/reload buttons "report the failing call's own error", but the diff makes waitForRunning/waitForStopped tri-state and has svcAction raise its own "rpcd is not answering" message and skip /usr/share/qosify-luci/cleanup on an unanswered poll. Say that the service actions now fail rather than clean up when the poll goes unanswered.

Generated by Claude Code

Comment thread applications/luci-app-qosify/htdocs/luci-static/resources/view/qosify/main.js Outdated
Comment thread applications/luci-app-qosify/htdocs/luci-static/resources/view/qosify/main.js Outdated
@choppyc79
choppyc79 force-pushed the luci-app-qosify-unknown-state branch 3 times, most recently from 2352634 to 95df3cc Compare September 20, 2026 18:39

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 95df3cc "luci-app-qosify: report an unanswered status call as unknown" — body (and the PR description) still says the cause is "named once on the Running row"; mark() now hangs the note on the first row that reads Unknown. Reword to say the first Unknown row.
  • 95df3cc (same) — body still says the start/stop/restart/reload buttons "report the failing call's own error", but svcAction raises its own "rpcd is not answering" on an unanswered poll and skips /usr/share/qosify-luci/cleanup after a stop. Say the action fails instead of cleaning up.
  • 95df3cc (same) — applyService() now restarts qosify when service.list goes unanswered, so a save can start a stopped qosify; the body's save paragraph only covers the shaping warning. Add a line for the restart-on-unknown fallback.

Generated by Claude Code

rpc.declare() resolves a ubus error status unless reject is set, so a
status code (6 once the session's ACL no longer covers the object, 4
when the object is gone) stays in result[0] and expect {'': {}}
rewrites it to the same {} a working call with nothing to report
returns. L.resolveDefault() cannot tell the two apart, so an ACL left
over from an older install, a stale session or a stopped rpcd reads as
a stopped, unshaped qosify with no init script.

Declare rc.list, service.list and qosify.status with reject: true and
catch each rejection to null. running, enabled, hasInit, active and
shaped are then null rather than false when the call was not answered,
and the Overview service table shows an amber Unknown badge for each,
with the cause named once, on the first row that reads Unknown. The
qosify object goes with the daemon, so an unanswered status call while
qosify is stopped still reads as not shaping.

The autostart button carries the state as its label, so it shows
Unknown and is disabled while the state is unknown. Its click now reads
the state from the last refresh rather than from when the button was
built, so a tick that changes the state also changes the action. The
start, stop, restart and reload buttons stay clickable. When the
service.list poll after a start, restart or stop goes unanswered, the
action fails with "rpcd is not answering" rather than reporting a
result it could not check, and a stop then skips
/usr/share/qosify-luci/cleanup instead of cleaning up.

A save no longer warns that qosify is not shaping when the check could
not run; it says shaping could not be checked. When service.list goes
unanswered while a save applies, qosify is restarted rather than
reloaded or started, since the config is already written and the
running state is unknown. That restart also starts a qosify that was
stopped.

The Status tab says rpcd is not answering rather than that qosify is
not running, and says the interface summary is unavailable when only
qosify status went unanswered.

updateEnBadge() gives the Config tab's QoS Enabled badge the same
treatment: with the section enabled and the status call unanswered it
reads Status Unknown, rather than the Enabled — Not Shaping (check
config) or Enabled — Not Running a null active used to fall through to.
A section disabled in UCI still reads Disabled — that state comes from
the config, not from the call, so an unanswered call does not put it in
doubt.

po/templates/qosify.pot regenerated with build/i18n-scan.pl.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Ash Clarke <clarkeaj@hotmail.co.uk>
@choppyc79
choppyc79 force-pushed the luci-app-qosify-unknown-state branch from 95df3cc to 0cda7ec Compare September 21, 2026 06:39
@choppyc79

Copy link
Copy Markdown
Contributor Author

Folded into #9054, which carries this commit unchanged as part of the
series. Closing in its favour.

@choppyc79 choppyc79 closed this Sep 21, 2026
@choppyc79
choppyc79 deleted the luci-app-qosify-unknown-state branch September 21, 2026 18:16
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.

2 participants