Fix several bugs in Pi-hole v6 API integration#33
Open
jpwalsh1 wants to merge 2 commits into
Open
Conversation
- Fix session expiry logic using sessionCreatedAt instead of lastUpdateTime
(lastUpdateTime was overwritten every second so sessions never reconnected)
- Fix polling interval to use fixed 1000ms instead of response.took * 1000
- Fix onclose handler to iterate all instances rather than undefined context
- Fix implicit global `data` variables in XHR callbacks (add let)
- Fix percent_blocked null crash with ?? 0 guard and try/catch in process_stat
- Fix json.parse -> JSON.parse crash in Property Inspector message handler
- Remove alert("logging!") debug popup from Property Inspector
- Remove dead updateSettings function
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Slow poll interval from 1s to 5s to reduce Pi-hole request volume - Add 5s timeouts to all XHR requests (status, stats, session delete) so slow/unreachable Pi-hole can't pile up open connections - Add in-flight guard to pollPihole to skip overlapping requests - Skip reconnect in writeSettings when connection params haven't changed, preventing double-connect on willAppear + didReceiveSettings - Guard keyUp handler against missing instance (race on first press) - Add default case to process_stat to avoid 'undefined' button title - Fall back to 300s in temporarily_disable when disable_time is empty - Fix implicit global jsonObj in pi.js; remove unused log function Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
datavariables in XHR callbacks (add let)