Skip to content

Silence config dialog warnings and dedupe HTTP error messages#4

Open
Plenvorik wants to merge 1 commit into
KodyMike:mainfrom
Plenvorik:feature/bugfixes
Open

Silence config dialog warnings and dedupe HTTP error messages#4
Plenvorik wants to merge 1 commit into
KodyMike:mainfrom
Plenvorik:feature/bugfixes

Conversation

@Plenvorik
Copy link
Copy Markdown

Two small cosmetic cleanups.

Silence config-dialog QML warnings. Opening the widget's settings
dialog logs nine warnings of the form FormLayout does not have a property called cfg_claudeRefreshSecsDefault (one per cfg_* key)
plus FormLayout does not have a property called title. KDE's KCM
framework writes cfg_<key>Default and title onto the config page
root as initial properties; without matching declarations the writes
fail loudly. Functionally harmless — the "Reset to defaults" button
still recovers values from main.xml — but noisy in journalctl.
This declares the missing properties with defaults kept in sync with
main.xml, and accepts title as a no-op so KCM's initial write
succeeds silently.

Dedupe HTTP error messages. classify_http_failure() always
concatenates "<status>: <api_msg>", but the API body frequently
begins with the same label, producing messages like
"Rate limited: Rate limited. Please try again later." Now if
api_msg starts with our status label (case-insensitive), we use
api_msg verbatim; otherwise the concat path is unchanged. Covered
by manual tests for 401 / 429 / 500 with and without body overlap.

Both changes are KDE only; the GNOME extension is untouched.

Two small cosmetic cleanups.

Silence QML config-dialog warnings. Opening the widget's settings
logs nine warnings like "FormLayout does not have a property called
cfg_claudeRefreshSecsDefault" and "... called title". KDE's KCM
framework writes `cfg_<key>Default` and `title` onto the config page
root as initial properties; without matching declarations the writes
fail loudly. Functionally harmless — the "Reset to defaults" button
still recovers values from main.xml — but noisy. Declare the missing
properties with defaults kept in sync with main.xml, and accept
`title` as a no-op property so KCM's initial write succeeds.

Dedupe HTTP error messages. `classify_http_failure()` always
concatenates "<status>: <api_msg>", but the API body often begins
with the same label, producing "Rate limited: Rate limited. Please
try again later.". Now if `api_msg` starts with the status label
(case-insensitive), we use `api_msg` verbatim; otherwise the concat
path is unchanged.

Both changes are KDE only; the GNOME extension is untouched.
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.

1 participant