Code Monkey home page Code Monkey logo

Comments (11)

ajbarry avatar ajbarry commented on June 5, 2024 2

Noice. Thanks @thorsten-stripe! Looking forward to the release... We will need it for sure...

@JakeMalis I just ran into the first issue that this fix will solve for us (if you are also combining the user/customer collection).
Since the createCustomer is triggered from a Firebase Auth hook, I just hit a race condition where my own createUser function fails because createCustomer triggered before my call to firestore.collection('users').doc(uid).create(props).

I could simply change the firestore call from create(props) to set(props, {merge: true}) but then I loose the strong semantics I have around create vs update on my users collection without guarding every call myself.

It's a race so I don't always get this error and my logic could be refactored to account for it but I will opt to disable createCustomer when it is available. Thanks again @thorsten-stripe.

from stripe-firebase-extensions.

thorsten-stripe avatar thorsten-stripe commented on June 5, 2024

Unfortunately deleting the createCustomer function via the Firebase console will cause future updates to error (see #51 (comment)).

@jhuleatt are there any plans to allow on/off toggles per function during the installation of the extension? If not we'd have to build that in via some configuration dropdown for example?

from stripe-firebase-extensions.

JakeMalis avatar JakeMalis commented on June 5, 2024

Related to this question: I would love if there weren't two separate collections for customers and users. I have each Firebase auth user saved as Firestore doc with their uid as their name. I think most people also have it that way, it would be nice if all the stripe data was stored within their user doc.

from stripe-firebase-extensions.

GClock avatar GClock commented on June 5, 2024

Thank you @thorsten-stripe for your reply .It would be nice to have the ability to have on/off toggle functions during extension deployment/upgrade in future.

One more question I have on the integration. Stripe checkout does not support billing_cycle_anchor .I would have liked to have this so that I can consistently follow a single cycle for every customer.Without this we have to have complicated logic of resetting things every day based on users subscription .Appreciate any suggestion you may have on this.

from stripe-firebase-extensions.

ajbarry avatar ajbarry commented on June 5, 2024

@JakeMalis I wasn't aware either but it sounds like a single user/customer collection is supported: #51 (comment)

I'm going to test this out myself and will post back if I find anything adverse.

from stripe-firebase-extensions.

JakeMalis avatar JakeMalis commented on June 5, 2024

@ajbarry Thank you so much for sending me this, that helps a lot!

from stripe-firebase-extensions.

thorsten-stripe avatar thorsten-stripe commented on June 5, 2024

While this doesn't allow enabling/disabling of functions per se (that would be a feature request to the Firebase Extensions team), #77 allows the disabling of syncing customers on creation, which should solve most of the issues reported here. This will roll out with the next release v. 0.1.7, hopefully on Thursday PT.

from stripe-firebase-extensions.

ajbarry avatar ajbarry commented on June 5, 2024

Hey @thorsten-stripe ... any word on the 0.1.7 release for this fix?

from stripe-firebase-extensions.

thorwebdev avatar thorwebdev commented on June 5, 2024

@ajbarry sorry for the delay, the Firebase team has moved to a biweekly (every other week) release schedule. I checked with @jhuleatt and he let me know that it's scheduled for release on Thursday Oct 22nd PT time.

from stripe-firebase-extensions.

ajbarry avatar ajbarry commented on June 5, 2024

Ok great. Thanks for the update @thorsten-stripe

from stripe-firebase-extensions.

Renkon117 avatar Renkon117 commented on June 5, 2024

Noice. Thanks @thorsten-stripe! Looking forward to the release... We will need it for sure...

@JakeMalis I just ran into the first issue that this fix will solve for us (if you are also combining the user/customer collection).
Since the createCustomer is triggered from a Firebase Auth hook, I just hit a race condition where my own createUser function fails because createCustomer triggered before my call to firestore.collection('users').doc(uid).create(props).

I could simply change the firestore call from create(props) to set(props, {merge: true}) but then I loose the strong semantics I have around create vs update on my users collection without guarding every call myself.

It's a race so I don't always get this error and my logic could be refactored to account for it but I will opt to disable createCustomer when it is available. Thanks again @thorsten-stripe.

I have been looking for someone who had the same issue like this!!

from stripe-firebase-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.