orange-jordan-21834
06/04/2025, 10:43 AM{ "type": "none" }
• Free delivery enabled: { "type": "delivery", "charge": 0 }
• Express delivery enabled: { "type": "express-delivery", "charge": 0 }
In production, we’re manually forcing a specific type for certain users by targeting their IDs. However, some users are still receiving the default value unexpectedly.
Technical Context
• Customer attributes are populated from DynamoDB on app initialization.
• If the app is not killed and relaunched, these attributes are not updated again.
• We use the following logic to set attributes:
js
const user = useSelector(selectUser);
const attributes = useAttributes(user); // React 19 Suspense-ready async logic
useEffect(() => {
const current = gbInstance.getAttributes();
const incomingID = attributes?.id || attributes?.adid;
if (current?.id === incomingID || current?.adid === incomingID) {
return;
}
gbInstance.setAttributes(attributes);
}, [gbInstance, attributes?.id, attributes?.idfa]);
C*urrent Problem*
• Attribute updates are not happening frequently enough, so customers are getting targeted more than once, which violates the experiment goal.
• The forced values via targeting seem to be ignored, and the default is applied in some cases.
Desired State
We’d like GrowthBook to be updated immediately after DynamoDB is updated with new customer attributes — so that customers can be accurately targeted only once.
Questions
1. What is the best practice for syncing updated user attributes mid-session or mid-app lifecycle?
2. Is there a way to "re-evaluate" the experiment exposure after updating attributes manually?
3. Have you observed any recent issues or lag in attribute sync or targeting logic?
4. Would using a unique session identifier help isolate and limit targeting to a single exposure?
This is a time-sensitive issue, so your guidance will be very much appreciated.strong-mouse-55694
06/04/2025, 3:12 PMuseEffect
hook is actually updating as expected. Additionally, have you tried using our Dev Tools to help debug? That might provide some additional context on which attributes GrowthBook is currently seeing.orange-jordan-21834
06/13/2025, 7:15 AMpurple-breakfast-88896
06/13/2025, 9:20 AMstrong-mouse-55694
06/13/2025, 2:02 PMpurple-breakfast-88896
06/16/2025, 5:49 AM