You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve parser cache collision with dual typeCast connections (#3644)
* fix: resolve parser cache collision with dual typeCast connections
The parser cache system had a bug where connections with different
typeCast boolean values (true vs false) would share cached parsers,
causing incorrect data type conversion.
Update `parser_cache.js` with following changes :
- Enhanced cache key generation to create unique keys for each typeCast value
- Now typeCast: true and typeCast: false generate distinct cache keys
- Maintains function-based typeCast compatibility
- Ensures proper cache isolation and eliminates ambiguous cache hits
Add test to validate changes in `test-typecast-dual-connections.test.cjs`
with following changes :
- Added test-typecast-dual-connections.test.cjs to validate the fix
- Tests concurrent connections with different typeCast boolean settings
- Prevents future regressions in parser cache logic
Signed-off-by: Mohit Malhotra <[email protected]>
* enh: update parser key generation condition for typecast and tests to match parser cache behavior
Update test expectations for `typeCast` field to reflect actual implementation
where `typeCast` returns the value directly instead of the type.
This aligns tests with the `lib/parsers/parser_cache.js` key generation logic.
Add more robust check for generating key for parser caching for the field `tyepCast`
to ensure value is used for only boolean input. Also removed `test-typecast-dual-connections.test.cjs`
as existing testcases are sufficient.
Signed-off-by: Mohit Malhotra <[email protected]>
---------
Signed-off-by: Mohit Malhotra <[email protected]>
0 commit comments