mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 13:31:14 -05:00
Implement 100% atomic transaction rollout
Update actions.ts and ApprovalTransactionToggle.tsx to default to the new atomic transaction RPC flow. The feature flag can now be used to disable the new flow for emergency rollback.
This commit is contained in:
@@ -178,9 +178,9 @@ export async function approvePhotoSubmission(
|
||||
* @returns Action result
|
||||
*/
|
||||
/**
|
||||
* Feature flag to enable atomic transaction RPC approval flow.
|
||||
* Set to true to use the new process-selective-approval-v2 edge function
|
||||
* that wraps the entire approval in a single PostgreSQL transaction.
|
||||
* Feature flag: Use new atomic transaction RPC for approvals (v2)
|
||||
*
|
||||
* ✅ DEFAULT: NEW atomic transaction flow (100% ROLLOUT)
|
||||
*
|
||||
* Benefits of v2:
|
||||
* - True atomic transactions (all-or-nothing)
|
||||
@@ -188,11 +188,11 @@ export async function approvePhotoSubmission(
|
||||
* - Network-resilient (edge function crash = auto rollback)
|
||||
* - Eliminates orphaned entities
|
||||
*
|
||||
* To enable: localStorage.setItem('use_rpc_approval', 'true')
|
||||
* To disable: localStorage.setItem('use_rpc_approval', 'false')
|
||||
* To disable NEW flow (emergency rollback): localStorage.setItem('use_rpc_approval', 'false')
|
||||
* To re-enable NEW flow: localStorage.removeItem('use_rpc_approval')
|
||||
*/
|
||||
const USE_RPC_APPROVAL = typeof window !== 'undefined' &&
|
||||
localStorage.getItem('use_rpc_approval') === 'true';
|
||||
localStorage.getItem('use_rpc_approval') !== 'false';
|
||||
|
||||
export async function approveSubmissionItems(
|
||||
supabase: SupabaseClient,
|
||||
|
||||
Reference in New Issue
Block a user