#robinsky_code

1 messages ¡ Page 1 of 1 (latest)

rotund raftBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1379517245067235348

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

lunar whale
#

I can share the sentry link if you want

whole jetty
#

hello! i'm not very familiar with expo so i'm checking to see if someone else is able to help you out here

lunar whale
#

No problem. Thank you.

#

Recursive cache lookups in folly::EvictingCacheMap triggered by user interaction in the payment form caused a stack overflow.

User performs a multi-tap gesture on the payment form UI.
The breadcrumb _handleMultiTapGesture indicates a user interaction, likely triggering an event handler in the application's UI layer. This is the initial external trigger for the subsequent internal processing.

The multi-tap gesture event is processed by the React Native runtime and dispatched to JavaScript.

The stack trace shows facebook::react::RuntimeScheduler_Modern::runEventLoopTick, facebook::react::Task::execute, and facebook::jsi::Function::call, indicating the event is picked up by the React Native scheduler and executed as a JavaScript function via the JSI interface and Hermes engine.

The executed JavaScript code initiates an operation that requires accessing a cache.
The stack trace includes facebook::react::SimpleThreadSafeCache<T>::get, showing that the JavaScript execution path leads to a lookup in a thread-safe cache, which internally uses folly::EvictingCacheMap.

Accessing the cache triggers an unintended recursive sequence of cache lookups.
The core of the issue is seen in the repeated stack frames for folly::EvictingCacheMap<T>::find, findImpl, and findInIndex. This indicates that the process of finding an item in the cache is recursively calling itself, likely due to a logic error in how cache misses, dependencies, or data structures are handled under specific conditions triggered by the user interaction.

As the recursive calls to cache lookup functions continue without a proper base case or termination condition, the call stack grows excessively large, consuming all allocated stack space.

The operating system terminates the process due to the stack overflow.
A stack overflow is an unrecoverable error. The system detects this condition and sends a SIGABRT signal (Signal 6) to the process, causing it to abort.

whole jetty
#

can you clarify what you're sharing here? do you have anything that looks like a stack trace?

lunar whale
#

This is Seer from Sentry. I guess it's their AI bot that summarize error trace log.

#

I can share the sentry link to you.

whole jetty
#

yeah, if you want to share that i can try taking a look

whole jetty
#

hmm i'm not sure i'll be able to access this

lunar whale
#

true

whole jetty
#

are you sure stripe is involved in the crash here? i'm not seeing anything indicating that this is the case

lunar whale
#

Well at first I thought it would be the ephemeral key or how I generate the payment intent from my server but everything looks fine

#

And just to give you a better context

#

If I create a Payment Method with the Stripe Dashboard on test mode to that customer, I will be able to add a new payment method. The crash only occurs whenever its a payment method from a new customer (or a customer with no initial payment method)

#

I just created a card in my customer, and from there the component doesnt crash the app. (I can add/edit/proceed to payment without any problem)

whole jetty
#

are you able to reproduce the crashes?

lunar whale
#

Yes of course

#

In the video, when I tap the card input, it crashes. There is no log from the RN dev tools, only a disconnect modal.

rotund raftBOT
whole jetty
#

can you review your code to see if it's possible that you're recursively calling anything when clicking either the amount button or the "add money" button? maybe add logging on the functions that are called in there to see what gets logged?

lunar whale
#

const handleProceed = async () => {
if (!parseFloat(amount) || parseFloat(amount) <= 0) return;

    try {
        const ready = await initializePaymentSheet();
        // if (!ready) return;
        if (!ready) {
            Alert.alert("Payment Error", "Failed to initialize payment sheet.");
            return;
        }
        const result = await presentPaymentSheet();
        if (result?.error) {
            Sentry.captureException(result);
            console.log(result.error)
            Alert.alert(`Error code: ${result.error.code}`, result.error.message);
        } else {
            Sentry.captureException(result);
            console.log(result.error)
            Alert.alert('Success', 'Your order is confirmed!');
        }
    } catch (e) {
        Sentry.captureException(e);
        Alert.alert('Payment error', 'An unexpected error occurred. Please try again.');
    } finally {
        Sentry.captureException('BLOPP');
        setLoading(false);
    }
};

This is what trigger the Stripe Payment Sheet element. And yet, the crash doesnt log any error.

#

But the crash happens when I tap the stripe component so that is weird. I am probably missing something, I will try with a bare project to see if happens again

wary wigeon
#

Hi taking over for solanum as they had to step away. Let me know what happens with the more bare-bones app

lunar whale
#

I set-up the Payment Sheet element in my expo react-native app. I have the /payment-sheet route on my server which works fine. Then, I have trigger the handleProceed function to fetch the ephemeral key, payment intent, etc. to initialize the Payment Sheet. I can see the Payment Sheet opens, but whenever I try to add a payment method to a new customer, the app silently crashes with no logs.

#

"@stripe/stripe-react-native": "^0.47.1"
"expo": "~52.0.46"

wary wigeon
#

That looks like the same as before, no?