Fix the stores autosync time to the next schedule time always the next round hour.
For example if the store registered at 11:36h, the next scheduled time must be 12:00h.
Update the current stores too to sync in the next hour.
Fix the stores autosync time to the next schedule time always the next round hour.
For example if the store registered at 11:36h, the next scheduled time must be 12:00h.
Update the current stores too to sync in the next hour.
Update the calculate_next_sync_time function to always round up to the next full hour
Create a migration to update all existing stores to sync at the next round hour
Ensure new stores also get scheduled for the next round hour
This will ensure all auto-sync schedules align to round hours (e.g., 12:00, 13:00, etc.) regardless of registration time.
@fszontagh I'm starting work on this issue now!
I'll:
1. Update the `calculate_next_sync_time` function to always round up to the next full hour
2. Create a migration to update all existing stores to sync at the next round hour
3. Ensure new stores also get scheduled for the next round hour
This will ensure all auto-sync schedules align to round hours (e.g., 12:00, 13:00, etc.) regardless of registration time.
Applied to database: Migration successfully executed
Git commit: 243314e pushed to main branch
The migration has been applied to the production database and all existing stores are now synchronized to round hour marks!
✅ **Implementation Complete**
@fszontagh I've successfully implemented the auto sync time fix! Here's what was done:
## Changes Made
### 1. Updated `calculate_next_sync_time()` Function
The function now rounds up to the next appropriate time mark based on sync frequency:
- **hourly**: Always syncs at `:00` (e.g., 11:00, 12:00, 13:00)
- **30min**: Syncs at `:00` or `:30` (e.g., 11:00, 11:30, 12:00)
- **15min**: Syncs at `:00`, `:15`, `:30`, `:45`
- **6hours**: Syncs at `00:00`, `06:00`, `12:00`, `18:00`
- **daily**: Syncs at `00:00` (next midnight)
### 2. Updated All Existing Stores
All active stores have been updated to sync at the next round hour.
**Verification Results:**
- ✅ WooCommerce store (`woo.aicaller.hu`): Next sync at `11:00:00` UTC
- ✅ ShopRenter store (`smartboticsapptest`): Next sync at `11:00:00` UTC
Both stores are now scheduled to sync at the next full hour mark instead of their original registration times.
## Example Behavior
**Before:** Store registered at `11:36h` → Next sync at `12:36h`
**After:** Store registered at `11:36h` → Next sync at `12:00h` ✨
## Files Changed
- **Migration**: `supabase/migrations/20251120_fix_next_sync_round_hour.sql`
- **Applied to database**: Migration successfully executed
- **Git commit**: `243314e` pushed to main branch
The migration has been applied to the production database and all existing stores are now synchronized to round hour marks!
Fix the stores autosync time to the next schedule time always the next round hour.
For example if the store registered at 11:36h, the next scheduled time must be 12:00h.
Update the current stores too to sync in the next hour.
@fszontagh I'm starting work on this issue now!
I'll:
calculate_next_sync_timefunction to always round up to the next full hourThis will ensure all auto-sync schedules align to round hours (e.g., 12:00, 13:00, etc.) regardless of registration time.
✅ Implementation Complete
@fszontagh I've successfully implemented the auto sync time fix! Here's what was done:
Changes Made
1. Updated
calculate_next_sync_time()FunctionThe function now rounds up to the next appropriate time mark based on sync frequency:
:00(e.g., 11:00, 12:00, 13:00):00or:30(e.g., 11:00, 11:30, 12:00):00,:15,:30,:4500:00,06:00,12:00,18:0000:00(next midnight)2. Updated All Existing Stores
All active stores have been updated to sync at the next round hour.
Verification Results:
woo.aicaller.hu): Next sync at11:00:00UTCsmartboticsapptest): Next sync at11:00:00UTCBoth stores are now scheduled to sync at the next full hour mark instead of their original registration times.
Example Behavior
Before: Store registered at
11:36h→ Next sync at12:36hAfter: Store registered at11:36h→ Next sync at12:00h✨Files Changed
supabase/migrations/20251120_fix_next_sync_round_hour.sql243314epushed to main branchThe migration has been applied to the production database and all existing stores are now synchronized to round hour marks!