stripe-firebase-extensions
stripe-firebase-extensions copied to clipboard
Redirecting to the checkout page is very slow.
Bug report
-
Run Payments with Stripe
Describe the bug
When a user is redirected to the checkout page to start a subscription, it takes about 30 seconds. Most of the time is spent waiting for onSnapshot callback.
To Reproduce
console.log('addDoc(): ', new Date().toJSON());
const docRef = await db
.collection('customers')
.doc(currentUser.uid)
.collection('checkout_sessions')
.add({
price: 'price_(myPriceID)',
success_url: window.location.origin,
cancel_url: window.location.origin,
});
console.log('onSnapshot(): ', new Date().toJSON());
docRef.onSnapshot((snap) => {
console.log('snapshot callback: ', new Date().toJSON(), snap.data());
const { error, url } = snap.data();
if (url) {
// We have a Stripe Checkout URL, let's redirect.
window.location.assign(url);
}
});
Result
addDoc(): 2023-02-20T16:36:29.717Z onSnapshot(): 2023-02-20T16:36:30.372Z snapshot callback: 2023-02-20T16:36:30.590Z { price: '...', success_url: '...', cancel_url: '...'} snapshot callback: 2023-02-20T16:36:58.847Z { price: '...', success_url: '...', cancel_url: '...', url: '...', sessionId: '...', mode: '...', created: {...}, client: '...'}
Expected behavior
I want to redirect users more quickly.
Screenshots
Logs of Cloud Functions and Firestore.

System information
- OS: macOS
- Browser: Chrome
Additional context
・This issue occurs when a user has not been redirected to the checkout page for 2-3 days. ・This issue is a bit similar to #68.
Seeing the same, even with a minimum instances provisioned (should keep warm??)
Experiencing the same issue.
Same here, it is incredibly slow.
Has anyone had any luck solving this? I have a minimum instance and its still taking like 30 seconds..
Has anyone had any luck solving this? I have a minimum instance and its still taking like 30 seconds..
Same to me. Could you please someone provide a solution for that?
Thanks,
Same here. Has anyone managed to resolve this issue ?