Commit 0af87a6
2.78.0 release (#563)
* Add `loadFlags` method to FeatureFlagManager
Adds a public method for manually refetching feature flags on demand.
Deduplicates concurrent requests by returning the existing in-flight
promise when a fetch is already in progress.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix in-flight test to use a hanging fetch promise
The previous test relied on microtask timing which could allow the
fetch to complete before loadFlags was called, making the test pass
even without deduplication logic.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Propagate errors from loadFlags, fix race conditions, and add tests
- loadFlags() now returns a Promise that rejects on fetch failure via
a new `propagateErrors` parameter on fetchFlags (backwards compatible)
- loadFlags always starts a new fetch even when one is in-flight,
avoiding a race condition where callers could miss error signals
- Add double markFetchComplete guard to prevent redundant cleanup
- Add pre-init guard so loadFlags resolves gracefully before init
- Update TypeScript declarations with load_flags()
- Add tests for error propagation, race conditions with in-flight
fetches (init and updateContext), and flag state preservation
after failures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Restore in-flight fetch deduplication for loadFlags
loadFlags() now reuses an in-flight fetch instead of starting a new one.
Tracks fetch errors via _lastFetchError so the loadFlags promise still
rejects on failure even when reusing a shared fetchPromise.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add CLAUDE.md for flags module with codebase conventions
Documents testing, code style, public API patterns, and error
handling conventions discovered during loadFlags implementation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refactor fetchFlags to always reject on error and flatten promise chains
- Remove propagateErrors param; fetchFlags now always rejects on error
- Fire-and-forget callers (init, updateContext, identify) swallow errors
at the call site with .catch(function() {})
- Flatten nested .then() into a flat promise chain with .bind(this)
- Simplify loadFlags to directly return fetchPromise (no _lastFetchError)
- Update tests to reflect new error propagation behavior
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Remove cjs import and follow snippet approach (#409)
* Remove cjs import and follow snippet approach
* add fallback for module-cjs
* Add error logging to fire-and-forget fetchFlags catch blocks
Address PR review feedback: log contextual error messages in silent
catch blocks so failures are visible in the console.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Revert "FF-603: loadFlags error propagation, race condition fixes, and tests" (#412)
* Add when_ready API and fix updateContext setMpConfig call (#414)
Add whenReady()/when_ready() public method to FeatureFlagManager that
returns the in-flight fetch promise if one exists, otherwise resolves
immediately. This allows consumers to await flag readiness without
accessing internal properties.
Fix updateContext() to pass a config object to setMpConfig() instead of
two positional arguments, matching the set_config(config) signature it
is bound to.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* FF-603: loadFlags error propagation, race condition fixes, and tests (#413)
Re-apply changes from PR #394 onto 2.78.0-rc branch.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* build rc1
* release build
* update changelog for 2.78.0
* 2.78.0
* fix changelog version
---------
Co-authored-by: Mark Siebert <mark.siebert@mixpanel.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: dhaval-valotia <163026311+dhaval-valotia@users.noreply.github.com>
Co-authored-by: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com>1 parent 73cef39 commit 0af87a6
44 files changed
Lines changed: 1574 additions & 1007 deletions
File tree
- dist
- async-modules
- src
- flags
- tests
- browser/client
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
3971 | 3971 | | |
3972 | 3972 | | |
3973 | 3973 | | |
3974 | | - | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
3975 | 3977 | | |
3976 | 3978 | | |
3977 | 3979 | | |
| |||
4012 | 4014 | | |
4013 | 4015 | | |
4014 | 4016 | | |
4015 | | - | |
4016 | | - | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
| 4021 | + | |
| 4022 | + | |
4017 | 4023 | | |
4018 | 4024 | | |
4019 | 4025 | | |
| |||
4050 | 4056 | | |
4051 | 4057 | | |
4052 | 4058 | | |
4053 | | - | |
4054 | | - | |
4055 | | - | |
4056 | | - | |
4057 | | - | |
4058 | | - | |
4059 | | - | |
4060 | | - | |
4061 | | - | |
4062 | | - | |
4063 | | - | |
4064 | | - | |
4065 | | - | |
4066 | | - | |
4067 | | - | |
4068 | | - | |
4069 | | - | |
4070 | | - | |
| 4059 | + | |
| 4060 | + | |
| 4061 | + | |
| 4062 | + | |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
4071 | 4078 | | |
4072 | | - | |
4073 | | - | |
4074 | | - | |
4075 | | - | |
4076 | | - | |
4077 | | - | |
4078 | | - | |
4079 | | - | |
4080 | | - | |
4081 | | - | |
4082 | | - | |
4083 | | - | |
4084 | | - | |
4085 | | - | |
4086 | | - | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
4087 | 4084 | | |
4088 | | - | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
4089 | 4096 | | |
4090 | | - | |
4091 | | - | |
4092 | | - | |
4093 | | - | |
4094 | | - | |
4095 | | - | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
4096 | 4103 | | |
4097 | | - | |
4098 | | - | |
4099 | | - | |
4100 | | - | |
| 4104 | + | |
| 4105 | + | |
| 4106 | + | |
| 4107 | + | |
4101 | 4108 | | |
4102 | | - | |
4103 | | - | |
4104 | | - | |
4105 | | - | |
4106 | | - | |
4107 | | - | |
4108 | | - | |
4109 | | - | |
4110 | | - | |
4111 | | - | |
4112 | | - | |
4113 | | - | |
| 4109 | + | |
| 4110 | + | |
| 4111 | + | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
| 4118 | + | |
| 4119 | + | |
| 4120 | + | |
4114 | 4121 | | |
4115 | | - | |
4116 | | - | |
4117 | | - | |
4118 | | - | |
4119 | | - | |
4120 | | - | |
4121 | | - | |
4122 | | - | |
4123 | | - | |
4124 | | - | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
4125 | 4132 | | |
4126 | | - | |
4127 | | - | |
4128 | | - | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
4129 | 4136 | | |
4130 | | - | |
4131 | | - | |
4132 | | - | |
4133 | | - | |
4134 | | - | |
| 4137 | + | |
4135 | 4138 | | |
4136 | | - | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
4137 | 4142 | | |
| 4143 | + | |
4138 | 4144 | | |
4139 | 4145 | | |
4140 | 4146 | | |
4141 | 4147 | | |
4142 | 4148 | | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
| 4162 | + | |
4143 | 4163 | | |
4144 | 4164 | | |
4145 | 4165 | | |
| |||
4419 | 4439 | | |
4420 | 4440 | | |
4421 | 4441 | | |
| 4442 | + | |
| 4443 | + | |
| 4444 | + | |
| 4445 | + | |
| 4446 | + | |
| 4447 | + | |
| 4448 | + | |
4422 | 4449 | | |
4423 | 4450 | | |
4424 | 4451 | | |
| |||
4435 | 4462 | | |
4436 | 4463 | | |
4437 | 4464 | | |
| 4465 | + | |
4438 | 4466 | | |
| 4467 | + | |
4439 | 4468 | | |
4440 | 4469 | | |
4441 | 4470 | | |
| |||
9142 | 9171 | | |
9143 | 9172 | | |
9144 | 9173 | | |
9145 | | - | |
| 9174 | + | |
| 9175 | + | |
| 9176 | + | |
9146 | 9177 | | |
9147 | 9178 | | |
9148 | 9179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments