8000 feat(core)[OASIS-6054]: Change Error to LOG_LEVEL.WARNING for unfound event by circAssimilate · Pull Request #418 · optimizely/javascript-sdk · GitHub
[go: up one dir, main page]

Skip to content

feat(core)[OASIS-6054]: Change Error to LOG_LEVEL.WARNING for unfound event #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy 10000 statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 4, 2020

Conversation

circAssimilate
Copy link
Contributor
@circAssimilate circAssimilate commented Mar 3, 2020

Summary

  • Log a warning when an event key is not found in the datafile instead of throwing an Error
  • Log a warning mentioning that user tracking is not happening
  • Update actual error logger in catch to be an ERROR instead of INFO
  • Updated CONTRIBUTING.md instructions with CHANGELOG.md update instructions

In a similar vein as optimizely/java-sdk#361, the JavaScript SDK noise could be more configurable for use with integrations like Segment.

Note: Please pardon the prettier noise. I tried to do a prep PR in #419 but there are still changes when I save. The actual functionality changes are in 646665d.

Test plan

  • Updated unit test to cover new functionality
  • Ensure other tests pass

Issues

@@ -57,7 +57,10 @@ var DEFAULT_ONREADY_TIMEOUT = 30000;
function Optimizely(config) {
var clientEngine = config.clientEngine;
if (enums.VALID_CLIENT_ENGINES.indexOf(clientEngine) === -1) {
config.logger.log(LOG_LEVEL.INFO, jsSdkUtils.sprintf(LOG_MESSAGES.INVALID_CLIENT_ENGINE, MODULE_NAME, clientEngine));
config.logger.log(
Copy link
Contributor Author
@circAssimilate circAssimilate Mar 3, 2020

Choose a reason for hiding this comment

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

Most of this file's updates are Prettier changes. Here's the only updated part:

https://github.com/optimizely/javascript-sdk/pull/418/files#diff-742c29e45e027dd9699a4d4d2e76c03bR277-R323

@@ -46,11 +46,11 @@ var DECISION_SOURCES = enums.DECISION_SOURCES;
var DECISION_NOTIFICATION_TYPES = enums.DECISION_NOTIFICATION_TYPES;
var FEATURE_VARIABLE_TYPES = enums.FEATURE_VARIABLE_TYPES;

describe('lib/optimizely', function() {
describe('lib/optimizely', function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of this file's updates are Prettier changes. Here's the only updated part:

https://github.com/optimizely/javascript-sdk/pull/418/files#diff-f6d6b958bf1d05fe2016671164857766R1331-R1349

@coveralls
Copy link
coveralls commented Mar 3, 2020

Coverage Status

Coverage decreased (-0.06%) to 97.268% when pulling 08bfecc on derek/change_to_warning_on_unfound_event into a04a74a on master.

@circAssimilate circAssimilate removed their assignment Mar 3, 2020
circAssimilate pushed a commit that referenced this pull request Mar 3, 2020
Run prettier on files changed in #418 so it's easier to review
@circAssimilate circAssimilate force-pushed the derek/change_to_warning_on_unfound_event branch from 80b9cd6 to 0465565 Compare March 3, 2020 17:06
Derek Hammond added 2 commits March 3, 2020 11:10
… event

In a similar vein as optimizely/java-sdk#361,
the JavaScript SDK would be less noisy when being used with integrations
like Segment if we only logged a warning when an event key is not found
in the datafile. This PR will make that change and unblock event
tracking.
@circAssimilate circAssimilate force-pushed the derek/change_to_warning_on_unfound_event branch from 0465565 to 69ef35f Compare March 3, 2020 17:14
@circAssimilate circAssimilate force-pushed the derek/change_to_warning_on_unfound_event branch from 69ef35f to 646665d Compare March 3, 2020 20:10
@circAssimilate circAssimilate removed their assignment Mar 3, 2020
@@ -46,11 +46,11 @@ var DECISION_SOURCES = enums.DECISION_SOURCES;
var DECISION_NOTIFICATION_TYPES = enums.DECISION_NOTIFICATION_TYPES;
var FEATURE_VARIABLE_TYPES = enums.FEATURE_VARIABLE_TYPES;

describe('lib/optimizely', function () {
describe('lib/optimizely', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of this file's updates are Prettier changes. Here's the only updated part:

https://github.com/optimizely/javascript-sdk/pull/418/files#diff-f6d6b958bf1d05fe2016671164857766R1533-R1552

Copy link
Contributor
@mjc1283 mjc1283 left a comment

Choose a reason for hiding this comment

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

@circAssimilate LGTM. One last thing, could you please add an entry to CHANGELOG.md for this change?

@circAssimilate circAssimilate merged commit 6e00881 into master Mar 4, 2020
@circAssimilate circAssimilate deleted the derek/change_to_warning_on_unfound_event branch March 4, 2020 17:14
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.

4 participants
0