File tree Expand file tree Collapse file tree
packages/sync-engine/src/supabase Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -551,12 +551,23 @@ export class SupabaseSetupClient {
551551 await this . setupSigmaPgCronJob ( )
552552 }
553553
554+ // Set the comment status to installed here before invoking stripe-worker
555+ // edge function because the installation is effectively done at this time
556+ await this . updateComment ( { status : 'installed' , oldVersion } )
557+
554558 // Invoke stripe-worker immediately to trigger first sync for better UX on Supabase
555559 // dashboard. We want to see the first sync run immediately after an installation.
556- await this . invokeFunction ( 'stripe-worker' , 'POST' , this . workerSecret )
557-
558- // Set final version comment
559- await this . updateComment ( { status : 'installed' , oldVersion } )
560+ // This is done after marking the installation as completed in the comment because
561+ // running the `stripe-worker` might take some time and timeout the actual installation
562+ // if done before. This is fine because even if this invocation fails for some reason
563+ // the installation is still completed and this is invoked on a best effort basis
564+ // to improve UX.
565+ try {
566+ await this . invokeFunction ( 'stripe-worker' , 'POST' , this . workerSecret )
567+ } catch ( error ) {
568+ const errorMessage = error instanceof Error ? error . message : String ( error )
569+ console . warn ( `Failed to invoke stripe-worker: ${ errorMessage } ` )
570+ }
560571 } catch ( error ) {
561572 const errorMessage = error instanceof Error ? error . message : String ( error )
562573 try {
You can’t perform that action at this time.
0 commit comments