Skip to content

Conversation

@elaine-mattos
Copy link
Contributor

Hi,

as part of the Node.js and package updates effort (#1340), here is the follow-up PR that adds backward compatibility to handle Redis cache entries compressed with both pako 1.x (binary string) and pako 2.x (base64) formats, preventing cache invalidation during the upgrade.

Summary

Adds backward compatibility to handle Redis cache entries compressed with both pako 1.x (binary string) and pako 2.x (base64) formats, preventing cache invalidation during the upgrade.

Changes

  • Format detection in redis.js: Automatically detects whether cached data is in old binary string format (pako 1.x) or new base64 format (pako 2.x)
  • Backward compatibility: Existing cache entries remain readable after upgrading to pako 2.x
  • Test coverage: Added comprehensive tests for both def_* (definitions) and hrv_* (harvest) key patterns

Testing

  • Unit tests verify reading both old (pako 1.x binary) and new (pako 2.x base64) formats
  • Tested with local Redis container using keys written with pako 1.x and read with pako 2.x
  • Tests use both pako@1.0.8 and pako@2.1.0 to prove cross-version compatibility

Benefits

  • Zero cache invalidation on deployment
  • Seamless migration from pako 1.x to 2.x
  • Both formats coexist during transition period

Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant