Repository navigation
fix: dashboard bugs with untimed rows, sessions and averaged spikes - #82
Merged
Merged
Conversation
- Fix a 500 error on the "All" range when the data has rows without a timestamp (e.g. stored before 'timestamp' was enabled). Missing times are now handled, and such rows are treated as the oldest instead of the newest; they are only included in the "All" range - Derive the session key from the password when no secret_key is set, so sessions work with several server processes (e.g. gunicorn workers) and across restarts; changing the password ends them - Return the lowest and highest value of each averaged chart point and use them to mark values outside min/max, so short spikes are no longer hidden by averaging; draw them as a band around the line - Update the docs on sessions and add tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCvw8haRnmyrVKrLkz5Yf8
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.
Three bugs in the
/exploredashboard found after #80.1. 500 error on the "All" range with rows without a timestamp
If
timestamp: truewas enabled after data had already been stored, the older rows have no time./explore/api/data?range=allfailed with a 500 error (NaTType does not support strftime), and these rows were sorted last, i.e. treated as the newest.NaT) are converted tonull.2. Password sessions with several server processes
Without
secret_key, each process created its own random key for the session cookie. With several gunicorn workers, a login was only valid on the worker that handled it, so users were sent back to the password prompt.secret_keyis configured, the key is derived from the password (HMAC-SHA256), so every process accepts the same sessions and they survive restarts. Changing the password ends all sessions. The key is not the password itself.secret_keyin the configuration still takes precedence.3. Short spikes hidden by averaging
With more than 1000 measurements, chart points are averaged, so a short spike outside
min/maxcould disappear: the header said "3 outside" while the chart showed fewer or no points./explore/api/dataalso returnsseries.lowandseries.high(lowest and highest value per point).min/maxfrom these, scales to include them, and draws them as a light band around the line.Tests
last_valid_time), only untimed rows, low/high per point, a single spike kept when averaged, no low/high without averaging, sessions shared between two app instances, a new password ending sessions, key not equal to the password. Six of them fail on the previous code.Generated by Claude Code