FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Drop a scheduled time the clock cannot show when the settings page loads by nishanm · Pull Request #211 · ktomy/nightscout-clock · GitHub

Repository navigation

Drop a scheduled time the clock cannot show when the settings page loads - #211

Merged
ktomy merged 1 commit into
ktomy:mainfrom
nishanm:fix/save-rejects-invalid-default-face
Oct 6, 2026
Merged

ktomy merged 1 commit into
ktomy:mainfrom
nishanm:fix/save-rejects-invalid-default-face

Conversation

nishanm commented Sep 22, 2026 •
edited
Loading

Copy link
Copy Markdown
Collaborator

Found while working #210. The settings page does not draw the schedule card while the schedule is off, so a scheduled time naming a face the clock does not have could not be seen or fixed there. The page posted it back on every save, and the firmware skips it on load with only a debug line: a setting that never takes effect.

normalizeLoaded now drops such a row when the page loads, the way it already repairs default_face. A row whose face is only switched off is kept, since the page can draw that one and say so.

Page-only: the earlier firmware checks are gone, per the review and 61f77f0. Checked by loading a config with rows naming face 99, no face, and a switched-off face: the first two are dropped and the third kept, while main keeps all three. The page builds.

🤖 Generated with Claude Code

adamecker pushed a commit to adamecker/nightscout-clock that referenced this pull request Oct 2, 2026
Validates default_face and face_schedule rows in /api/save, and drops
invalid schedule rows on load. Kept Adam's custom MAC validation.
adamecker pushed a commit to adamecker/nightscout-clock that referenced this pull request Oct 2, 2026

ktomy commented Oct 4, 2026

Copy link
Copy Markdown
Owner

please, please, do all the validations on the client. Let's keep clock's firmware innocent and trustful. In practice this means less complexity in the firmware, it is way easier to debug some javascript than debug some c++ code on a relatively slow hardware. Thanks

The schedule card is not drawn while the schedule is off, so a row naming
a face the clock does not have could not be seen or fixed on the page,
and was posted back on every save. normalizeLoaded now drops it, the way
it already repairs default_face. A row whose face is only switched off is
kept, since the page can draw that one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nishanm changed the title Refuse a default face or a scheduled time the clock cannot show Drop a scheduled time the clock cannot show when the settings page loads Oct 5, 2026

nishanm commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Agreed, and I see you've already removed the save checks from ServerManager in 61f77f0. I've dropped all the firmware changes from this PR and rebased it onto main. What's left is page-only: when the settings page loads, it drops a scheduled time that names a face the clock doesn't have. While the schedule is off its card isn't drawn, so a bad row couldn't be seen or fixed, and it was saved back every time. A row whose face is just switched off is kept, since the page can show that one.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL