Commit 5648f64
committed
fix(settings): homeassistant-ai#1431 review pass — address 13 verified findings (homeassistant-ai#1164)
Round-3 review pass landed 13 verified findings; the cosmetic
"persisted-value visible in UI after F5" item was explicitly skipped
per user direction (UI shows post-gate value when master off; user
accepts this since beta tools are actually disabled at runtime — the
preserve-across-master-cycle UX is at the data layer, not the visual).
Source fixes:
- **Save button copy is now source-blind** — the previous "your
feature-flag toggles already saved on click" claim only held when
``saveFeatureFlag`` raised ``restartNotice``; tool-config pin saves,
backup-config saves, and cross-tab ``restart-required`` broadcasts
also raise it. New copy: "a restart is pending. Click Restart above
to apply your prior changes." (#2)
- **Stale F.37 test docstring** describing the deleted server-side
cascade rewritten. (#3)
- **Beta-gate INFO log noise** — cascade-clear removal meant the gate
could fire its "forcing %s=False" line every Settings rebuild,
spamming addon logs once a user had truthy sub-flags persisted.
Dedup via ``_BETA_GATE_LOGGED`` set per process, cleared on
``_reset_global_settings``. (#9)
- **Lazy-lock docstring** updated to reflect Python 3.13 semantics
(``asyncio.Lock()`` no longer takes a loop arg; the lazy pattern
still serves test fixtures and single-loop deployment, with the
invariant documented). (#10)
- **Addon-mode carve-out comment** clarified to distinguish dev
(master in schema) from stable (master web-UI-only). (homeassistant-ai#14)
- **probe-div null branch** in F.37 now writes ``data-error`` so a
failing test points at "selector missed" vs "value flipped"
unambiguously. (homeassistant-ai#17)
Tests added:
- ``test_translations_cover_every_schema_key`` — parity check that
every ``schema:`` key has a non-empty translation ``name`` and
``description``. Parameterised across stable + dev addons. Pins
the class of silent gap that this PR's ``advanced_debug_logging``
fix addressed. (#4)
- ``test_save_features_acquires_override_file_lock`` +
``test_save_advanced_acquires_override_file_lock`` — counting-lock
wrapper asserts ``async with _get_override_file_lock()`` runs
exactly once in each file-mode write path. Pin against a regression
that silently bypasses concurrent-save serialisation. (#5)
- ``test_dual_save_buttons_mirror_disabled_and_status_on_post_failure``
— exercises the 500-response branch of the dual-save mirror so a
regression that broke ``_setAdvSaveStatus``/``_setAdvSaveDisabled``
for error paths only would still fail. (#6)
- ``test_save_features_master_on_restores_subflag_values_in_addon_mode``
— addon-mode round-trip mirror of the existing standalone restore
test; asserts the Supervisor merge-and-post call carries only the
master flip-on and never zeroes out sub-flag values. (#7)
- ``test_save_button_nothing_to_save_when_no_dirty_and_no_restart`` +
``test_save_button_restart_pending_hint_when_dirty_empty_but_restart_showing``
— both branches of the empty-dirty Save click are exercised; the
restart-pending branch asserts the copy is source-blind. (#8)
Deferred per user direction:
- #1 (file-vs-Settings visual after F5): user accepts the current
behavior (UI shows post-gate value; runtime tools actually
disabled when master off; data-layer preserve still works
end-to-end).
- #11/#12/homeassistant-ai#13 (code-simplifier helper extractions): skipped as
complicated to implement without behavior risk.
- homeassistant-ai#15 (pre-homeassistant-ai#1164 users with already-cleared sub-flags): release-note
concern, not a code change.
- homeassistant-ai#16 (lock fragility under future thread-pool dispatch):
speculative future-risk; not actionable today.1 parent c030148 commit 5648f64
5 files changed
Lines changed: 497 additions & 31 deletions
File tree
- src/ha_mcp
- tests
- addon
- src/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
818 | 825 | | |
819 | 826 | | |
820 | 827 | | |
821 | 828 | | |
822 | 829 | | |
| 830 | + | |
823 | 831 | | |
824 | 832 | | |
825 | 833 | | |
| |||
954 | 962 | | |
955 | 963 | | |
956 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
957 | 973 | | |
958 | 974 | | |
959 | 975 | | |
| |||
1231 | 1247 | | |
1232 | 1248 | | |
1233 | 1249 | | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
1234 | 1255 | | |
1235 | 1256 | | |
1236 | 1257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3547 | 3547 | | |
3548 | 3548 | | |
3549 | 3549 | | |
3550 | | - | |
3551 | | - | |
3552 | | - | |
3553 | | - | |
3554 | | - | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
3555 | 3554 | | |
3556 | 3555 | | |
3557 | 3556 | | |
3558 | 3557 | | |
3559 | 3558 | | |
3560 | | - | |
3561 | | - | |
| 3559 | + | |
| 3560 | + | |
3562 | 3561 | | |
3563 | 3562 | | |
3564 | 3563 | | |
| |||
3945 | 3944 | | |
3946 | 3945 | | |
3947 | 3946 | | |
3948 | | - | |
3949 | | - | |
3950 | | - | |
3951 | | - | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
3952 | 3956 | | |
3953 | 3957 | | |
3954 | 3958 | | |
| |||
4466 | 4470 | | |
4467 | 4471 | | |
4468 | 4472 | | |
4469 | | - | |
4470 | | - | |
| 4473 | + | |
| 4474 | + | |
| 4475 | + | |
| 4476 | + | |
| 4477 | + | |
| 4478 | + | |
| 4479 | + | |
4471 | 4480 | | |
4472 | 4481 | | |
4473 | 4482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
57 | 58 | | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | | - | |
67 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
74 | 84 | | |
| 85 | + | |
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
81 | 92 | | |
82 | | - | |
| 93 | + | |
83 | 94 | | |
| 95 | + | |
84 | 96 | | |
85 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
86 | 100 | | |
87 | 101 | | |
88 | 102 | | |
| |||
95 | 109 | | |
96 | 110 | | |
97 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2928 | 2928 | | |
2929 | 2929 | | |
2930 | 2930 | | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
2931 | 3099 | | |
2932 | 3100 | | |
2933 | 3101 | | |
| |||
0 commit comments