Conversation
…stance The BPD stored by persist() keep segments in the shape the library version that received them could parse: business transactions unknown at that time are AnonymousSegments. Because a bank only resends the BPD when it bumps the BPD version, those segments stay anonymous across library upgrades, so e.g. DIKKUS (credit card statements, added in nemiah#574) looks unsupported to getLatestSupportedParameters() on every connection that already had a persisted instance. Parse such segments again on load; AnonymousSegment serializes to the original wire format, so nothing is lost.
|
@nemiah PR ist ready für's Review |
|
It probably won't break something and doesn't look too verbose for me. I'll merge it if your human takes responsibility |
Philipp91
left a comment
There was a problem hiding this comment.
This looks good.
Just for consideration: An alternative solution would be to somehow figure out the library version (maybe it can know its own semver from the deployment somehow?) and persist it as part of the BPD or FinTs instance or so. Then upon re-init, if the persisted version doesn't match the current library version (in either direction), just discard the BPD, so we'll end up requesting it from the server again. This would additionally cover cases where the server sends different BPD when it receives a different request. That said, we haven't changed the request we send for BPD retrieval in many years, so probably this wouldn't matter.
|
Thanks. I considered version-stamping, but the library can't reliably know its own version today ( |
Problem
persist()stores the BPD with the segments in the shape the then current library version could parse: business transactions it did not implement are kept asAnonymousSegment. A bank only resends the BPD when it bumps its own BPD version (HKVVBannounces ours), so after a library upgrade those segments stay anonymous indefinitely.Concrete case with #574: every connection that already had a persisted instance keeps reporting
from
GetCreditCardStatement, although the bank's BPD containsDIKKUS:45:2:3+1+1+0+90:N:J'— until the bank happens to change something in its BPD. The same applies to any segment added in the future (e.g. HIWPDS v6 from #480).Change
BPD::reparseAnonymousSegments()re-parses anonymous parameter segments throughParser::detectAndParseSegment().AnonymousSegmentserializes to the original wire format, so nothing is lost; segments the library still does not implement stay anonymous.FinTs::loadPersistedInstance()calls it after restoring the BPD.Tests
Tests/Unit/Protocol/BPDReparseTest.php: an anonymous DIKKUS becomesDIKKUSv2(speicherzeitraum90) while an unknown segment stays anonymous, and the same throughFinTs::new()with a persisted instance.Note on authorship
Developed with AI assistance (Cursor) and reviewed by the submitting human; the vouching statement per #586 will be added by the author once the review is complete.