optimizely / react-sdk

React SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/javascript-react-sdk
Apache License 2.0
88 stars 33 forks source link

[BUG] ODP is not integrated error is thrown after upgrading from 2.9.2 to 3.1.0 #260

Closed twalker closed 1 month ago

twalker commented 2 months ago

Is there an existing issue for this?

SDK Version

3.1.0

Current Behavior

After upgrading from 2.9.2 to 3.1.0, a "ODP is not integrated" error is consistently thrown after experiment data is loaded:

[OPTIMIZELY] - INFO 2024-04-26T14:20:59.631Z OPTIMIZELY: Updated Optimizely config to revision 1502 (project id 13858570517) optimizely.browser.min.js:1:5824
07:20:59.630
[OPTIMIZELY] - ERROR 2024-04-26T14:20:59.631Z undefined: ODP is not integrated

Expected Behavior

"ODP is not integrated" Error is not thrown when upgrading from 2.9.2 to 3.11.0. If there are API changes that break for v2.9.2 consumers when upgrading, I'd expect a migration guide or instructions on how to handle/configure ODP in the optimizely provider. https://github.com/optimizely/react-sdk/blob/master/CHANGELOG.md#300---january-24-2024

I've attempted to disable ODP, but the same error is thrown:

    odpOptions: {
      disabled: true,
    },

Steps To Reproduce

Unfortunately, I cannot afford the time to isolate the source of the error in a simplified project.

React Framework

v18.2.0

Browsers impacted

All that I've tested: Chrome@124.0.6367.92 Firefox@5.0.2

Link

No response

Logs

[OPTIMIZELY] - ERROR 2024-04-26T14:20:59.631Z undefined: ODP is not integrated

optimizely-stack-trace

Severity

No response

Workaround/Solution

Wait to upgrade from v2.9.2 until breaking changes are documented and/or error no longer occurs.

Recent Change

No other changes to Optimizely configuration or data. Only updating the sdk.

Conflicts

No response

alexparish commented 2 months ago

I'm also seeing the same error log after upgrading.

jocodev1 commented 1 month ago

I've seen the same error upgrading to v3.1.0. However, you may want to recheck how you set the odpOptions. I was able to set this when creating the Optimizely instance and this worked for me.

    optimizely = createInstance({
      // ...
      odpOptions: {
        disabled: true
      }
    })

You should see an Optimizely log saying this if it worked:

[OPTIMIZELY] - INFO  2024-05-09T21:02:59.010Z ODP Disabled.
alexparish commented 1 month ago
    optimizely = createInstance({
      // ...
      odpOptions: {
        disabled: true
      }
    })

This is also how I resolved the issue.

However, I’d expect ODP to be disabled by default without needing to provide that configuration.

twalker commented 1 month ago

I've seen the same error upgrading to v3.1.0. However, you may want to recheck how you set the odpOptions. I was able to set this when creating the Optimizely instance and this worked for me.

    optimizely = createInstance({
      // ...
      odpOptions: {
        disabled: true
      }
    })

You should see an Optimizely log saying this if it worked:

[OPTIMIZELY] - INFO  2024-05-09T21:02:59.010Z ODP Disabled.

Disabling the odpOption resolves the error for me as well. I must've misconfigured the option during my initial attempts. Thanks @jocodev1 !

kimyu92 commented 1 month ago

Looks like this https://github.com/optimizely/react-sdk/pull/262 would resolve the issue

mikechu-optimizely commented 1 month ago

Thanks for the code review @kimyu92. We're working to get patch out shortly.

cc @junaed-optimizely

junaed-optimizely commented 1 month ago

Patch version 3.1.1 is out. An upgrade to 3.1.1 will fix the problem.