Skip to content

πŸ› v1.1.0 - Critical Cookies Fixes

Latest

Choose a tag to compare

@HEDELKA HEDELKA released this 04 Nov 11:27
· 10 commits to master since this release

πŸ› Critical Fixes for Cookies Handling

βœ… Fixed Issues:

  • Invalid character in header content ["Cookie"] - Cookies with special characters now work correctly
  • Library crashes when cookies.txt is missing - Graceful fallback implemented
  • Special characters in Google Analytics cookies - URL encoding added

✨ New Features:

  • Graceful fallback - Library works without AI functions when cookies are missing
  • Optional cookies loading - Use to disable AI functions
  • Cookie validation - Automatic validation of cookie format and characters
  • Enhanced error handling - Informative messages without crashes
  • isAIEnabled() method - Check if AI functions are available

πŸ”§ Improvements:

  • 100% backward compatibility - Existing code continues to work
  • Better reliability - Library always initializes successfully
  • Enhanced security - Automatic encoding of special characters
  • Improved developer experience - Clear error messages and graceful degradation

πŸ“ Usage Examples:

// Graceful fallback - works with or without cookies
const builder = new CustomAPIBuilder();
await builder.init();

if (builder.isAIEnabled()) {
    const result = await method.execute(data);
} else {
    console.log('AI functions disabled, but library works');
}

// Explicitly disable AI functions
const builder = new CustomAPIBuilder({ skipCookies: true });
await builder.init();

πŸ§ͺ Testing:

  • Comprehensive test suite included
  • Tested with real cookies containing special characters
  • All edge cases covered

πŸ“ Files Changed:

  • src/k2think-dialog.js - Cookie encoding and validation
  • src/api-builder.js - Graceful fallback implementation
  • src/cookie-converter.js - Enhanced validation methods
  • Added comprehensive tests and documentation

This release fixes critical integration issues and makes the library much more reliable! πŸš€