-
Notifications
You must be signed in to change notification settings - Fork 251
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 statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PLAT-8735] Preserve feature flag order #1802
Conversation
|
Minified | Minfied + Gzipped | |
---|---|---|
Before | 42.67 kB |
13.08 kB |
After | 43.13 kB |
13.19 kB |
± | +460 bytes |
+115 bytes |
code coverage diff
Ok | File | Lines | Branches | Functions | Statements |
---|---|---|---|---|---|
✅ | /home/runner/work/bugsnag-js/bugsnag-js/packages/core/client.js | 99.39% (+0.01%) |
97.65% (+0%) |
100% (+0%) |
98.87% (+0.01%) |
✅ | /home/runner/work/bugsnag-js/bugsnag-js/packages/core/event.js | 96.03% (+0.06%) |
93.15% (+0%) |
100% (+0%) |
96.3% (+0.06%) |
✅ | /home/runner/work/bugsnag-js/bugsnag-js/packages/plugin-electron-ipc/bugsnag-ipc-main.js | 83.08% (+0.27%) |
73.08% (+0%) |
89.47% (+0%) |
81.94% (+0.25%) |
✅ | /home/runner/work/bugsnag-js/bugsnag-js/packages/plugin-electron-renderer-event-data/renderer-event-data.js | 90.48% (+0.48%) |
81.25% (+0%) |
100% (+0%) |
91.3% (+0.39%) |
Total:
Lines | Branches | Functions | Statements |
---|---|---|---|
87.27%(+0.05%) | 75.52%(+0.05%) | 86.76%(+0%) | 86.2%(+0.05%) |
c1bc6bd
to
68bd1c3
Compare
68bd1c3
to
eabc08c
Compare
for (var i = 0; i < existingFeatures.length; i++) { | ||
if (existingFeatures[i].name === name) { | ||
found = true | ||
existingFeatures[i].variant = variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be safer to replace rather than mutate the object, since an event.features may also contain it?
e.g.
existingFeatures[i].variant = variant | |
existingFeatures[i].variant = { name, variant } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes any difference here, as the flag will have been cloned from the event, rather than referenced.
555f060
to
62a27df
Compare
Goal
To preserve the order of feature flags as they were added
Design
Changed internal feature storage from an object to an array, added relevant poly fills for IE11 compatibility
Testing
Unit and integration tests updated