Repository navigation
Drain Mobilithek delta buffers and apply charging status packets in order - #30
Merged
Merged
Conversation
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.
Mobilithek's delta pull returns the next buffered packet after
If-Modified-Since. A consumer fetching one response per minute falls progressively behind a feed delivering multiple packets per minute; the daily snapshot then makes most charging points appear frozen at its publication time.Add
PulpMobilithek::drainMobilithek()to bootstrap from the buffered snapshot and drain up to 200 ordered packets until 304/204. A final ETag-deduplicated head probe mitigates same-second collisions without advancing the sequential cursor or skipping an unfinished backlog. HTTP errors and invalid/non-advancing cursors fail the run.Apply status packets individually, recognize full packets through DATEX
codedExchangeProtocoleven whenTypeis empty, and reject older point timestamps. Commit the accumulator cache atomically only after a successful source run, preserving permissions; exposeaccumulatorVersion=2for consumer migrations. Document the remaining historical same-second pull limitation and durable push reception.Validation: all 217 PHPUnit tests pass on PHP 8.5 (839 assertions), including new drain/accumulator integration, snapshot-in-stream, cursor safety, failed-run rollback, and file permissions. Used the existing dependency installation with worktree source autoload overrides because a fresh dependency installation exceeded the /tmp quota; no dependency lock changes. PHP CS Fixer and
git diff --checkpass.Proposed releases after merge:
pulp-mobilithek1.1.0 andpulp-datex-energy1.1.2. Braunschweig adoption remains a draft until those packages are released and its Composer lock is refreshed. No production changes.Protocol reference: Mobilithek TSSB, sections 4.3, 4.7.2 and 4.8.