-
Notifications
You must be signed in to change notification settings - Fork 77
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
Remove duplicate FidesUpdated
event and trigger FidesInitialized
twice instead
#4365
Conversation
Passing run #4938 ↗︎
Details:
Review all test suite changes for PR #4365 ↗︎ |
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.
Comments and thoughts
clients/fides-js/src/fides-tcf.ts
Outdated
} | ||
dispatchFidesEvent("FidesUpdated", cookie, config.options.debug); | ||
// Dispatch the "FidesInitialized" event to update listeners with the initial state. | ||
// TODO PROD-1280: Suppress duplicate event if the cookie state is unchanged from an early initialization? |
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'm really not sure about this yet. I like the simplicity of this code right now, but the double-triggering of the event doesn't "feel" great. Looking for opinions 😄
// TODO PROD-1280: Suppress duplicate event if the cookie state is unchanged from an early initialization? | ||
// .should("have.been.calledOnce") |
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.
Note that we shouldn't check this in; need to decide what to do and then do it 👍
// TODO PROD-1280: Suppress duplicate event if the cookie state is unchanged from an early initialization? | ||
// .should("have.been.calledOnce") |
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.
Note that we shouldn't check this in; need to decide what to do and then do it 👍
clients/fides-js/src/fides.ts
Outdated
} | ||
dispatchFidesEvent("FidesUpdated", cookie, config.options.debug); | ||
// Dispatch the "FidesInitialized" event to update listeners with the initial state. | ||
// TODO PROD-1280: Suppress duplicate event if the cookie state is unchanged from an early initialization? |
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.
TODO note 👍
We decided to move forward with this implementation for now, but perhaps we should suppress the duplicate |
…twice instead (#4365) Co-authored-by: Allison King <[email protected]>
Closes PROD-1280
Description Of Changes
FidesUpdated
is now only called when a user makes a change, not after initialization.Screen.Recording.2023-10-31.at.4.23.37.PM.mov
Code Changes
FidesUpdated
in initialization logicFidesInitialized
callsSteps to Confirm
FidesInitialized
fired but noFidesUpdated
firedFidesUpdated
until you save your preferencesPre-Merge Checklist
CHANGELOG.md