braze-react-native-sdk
braze-react-native-sdk copied to clipboard
[Bug]: On android, calling `Braze.getContentCards` right after `Didomi.setUserStatusSets` returns a never-resolving promise
Which Platforms?
Android
Which React Native Version?
0.74.5
Which @braze/react-native-sdk SDK version?
11.0.0
Repro Rate
100% of the time, on release builds
Steps To Reproduce
NB: This is reproduced when using Braze & Didomi together, but the described erratic behaviour should be addressed regardless of Didomi implementation
import React, { useCallback, useEffect, useState } from 'react';
import Braze, { ContentCard } from '@braze/react-native-sdk';
import { Didomi, DidomiEventType } from '@didomi/react-native';
import { TouchableOpacity, View } from 'react-native';
const myVendors = ['my vendor id'];
export const App = () => {
const enableCookies = useCallback(async () => {
const currentUserStatus = await Didomi.getUserStatus();
await Didomi.setUserStatusSets(
currentUserStatus.purposes.consent.enabled,
currentUserStatus.purposes.consent.disabled,
currentUserStatus.purposes.legitimate_interest.enabled,
currentUserStatus.purposes.legitimate_interest.disabled,
[...currentUserStatus.vendors.consent.enabled, ...myVendors],
currentUserStatus.vendors.consent.disabled,
currentUserStatus.vendors.legitimate_interest.enabled,
currentUserStatus.vendors.legitimate_interest.disabled
);
}, []);
const [contentCards, setContentCards] = useState<ContentCard[]>([]);
useEffect(() => {
Didomi.addEventListener(DidomiEventType.CONSENT_CHANGED, async () => {
const cards = await Braze.getContentCards();
setContentCards(cards);
});
}, []);
return (
<View>
<TouchableOpacity onPress={enableCookies} />
{contentCards.map(renderCard)}
</View>
);
};
Expected Behavior
Braze.getContentCards() returns an array once cookies are enabled
Actual Incorrect Behavior
Braze.getContentCards() never resolves.
Regardless of Didomi integration, the call should return a value (error, empty array, filled array, ...) and not hang indefinitely
Verbose Logs
No response
Additional Information
No response
Hi @AmauryLiet ,
- Can you provide verbose logs of a reproduction of the issue?
- What device were you testing on?
- What Braze Android SDK version did you reproduce the issue on?
Closing out this issue due to inactivity.
If you would need further assistance, feel free to reach out to our support team at [email protected] with the supporting information listed above.
Thank you!