Skip to content

Conversation

@junaed-optimizely
Copy link
Contributor

Summary

Logging improvements for CMAB cache operations:

  • Added new log message constants for CMAB cache events (IGNORE_CMAB_CACHE, RESET_CMAB_CACHE, INVALIDATE_CMAB_CACHE, CMAB_CACHE_ATTRIBUTES_MISMATCH) in lib/message/log_message.ts.

Added missing logger in DefaultCmabService.

Test plan

Existing test should pass

Issues

  • FSSDK-11981

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances logging for CMAB (Contextual Multi-Armed Bandit) cache operations and fixes a missing logger dependency. The changes add four new log message constants for different cache events and ensure the DefaultCmabService receives a logger instance to use these messages.

  • Added four new log message constants for CMAB cache operations (ignore, reset, invalidate, and attributes mismatch)
  • Injected logger dependency into DefaultCmabService and added debug logging for cache operations
  • Optimized code by extracting userId to avoid repeated getUserId() calls

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lib/message/log_message.ts Added four new log message constants for CMAB cache events
lib/core/decision_service/cmab/cmab_service.ts Added logger usage for cache operations and optimized userId retrieval
lib/client_factory.ts Passed logger instance to DefaultCmabService constructor

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@coveralls
Copy link

coveralls commented Oct 20, 2025

Coverage Status

coverage: 78.502% (-0.2%) from 78.66%
when pulling fcc69c7 on junaed/fssdk-11981-bug-bash-addressed
into bfdcfad on master.

@junaed-optimizely junaed-optimizely merged commit 9c75ee1 into master Oct 20, 2025
11 of 18 checks passed
@junaed-optimizely junaed-optimizely deleted the junaed/fssdk-11981-bug-bash-addressed branch October 20, 2025 17:11
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.

5 participants