Repository navigation
Persist full-list writes to the remote feature cache - #261
Merged
Merged
Conversation
Remotes without partial write support receive the complete list, merged from the locally cached remote data. The remote replaces its list with what was written but notifies the change only after the result, so a second write built in between merged into the stale cache and reverted the first one: writing OPEV and OSCEV limits back to back left the obligation inactive on the Porsche PMCC. Persist the written list right away and restore the previous state if the remote rejects the write.
Contributor
Author
|
/cc @uhl |
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.
Follow-up to #253
Problem
Remotes that announce a list function as writeable without
partialsupport receive the complete list on every write.LoadControl.WriteLimitDataandDeviceConfiguration.WriteKeyValuesbuild that list by merging the new entries into the locally cached remote data (UpdateData(persist=false)), but the cache itself is only updated once the remote notifies the change, which happens after the result.A second write built in between, e.g. OPEV obligation limits followed by OSCEV recommendation limits, therefore merges into the stale cache and reverts the entries of the first write. On the Porsche PMCC this leaves the obligation limits inactive after every write; a disable (0.1A obligation) ends with all limits inactive and the EV charging at maximum. See evcc-io/evcc#34004 and evcc-io/evcc#34066 for traces.
Fix
Feature.writeFullListsends the write and persists the merged list as the remote feature's state right away. If the remote rejects the write, the response callback restores the previous state. Partial writes are unchanged.Test
Test_WriteLimitValues_Persist: after a full write the cache reflects the written limit while other entries are kept, and an error result restores the previous state. Fails ondevwithout the change.🤖 Generated with Claude Code