Fix FCM token registration and add queue reminder alerts
- Fix silent insert failure in FCM token registration (missing NOT NULL refresh_token column) so WebView app tokens are actually stored - Add 1-minute queue reminder cron that re-sends FCM alerts for calls still waiting, with transient-based throttle to prevent duplicates - Send FCM cancel on queue dequeue (answered/hangup/timeout), not just on final call status webhook - Clean up new cron hook on plugin deactivation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -265,6 +265,9 @@ class TWP_Core {
|
||||
|
||||
$queue = new TWP_Call_Queue();
|
||||
$this->loader->add_action('twp_process_queue', $queue, 'process_waiting_calls');
|
||||
|
||||
// Queue reminder alerts (re-send FCM every minute for waiting calls)
|
||||
add_action('twp_queue_reminders', array('TWP_Call_Queue', 'send_queue_reminders'));
|
||||
|
||||
// Callback processing
|
||||
$this->loader->add_action('twp_process_callbacks', 'TWP_Callback_Manager', 'process_callbacks');
|
||||
@@ -281,6 +284,10 @@ class TWP_Core {
|
||||
wp_schedule_event(time(), 'twp_every_30_seconds', 'twp_process_queue');
|
||||
}
|
||||
|
||||
if (!wp_next_scheduled('twp_queue_reminders')) {
|
||||
wp_schedule_event(time(), 'twp_every_minute', 'twp_queue_reminders');
|
||||
}
|
||||
|
||||
if (!wp_next_scheduled('twp_process_callbacks')) {
|
||||
wp_schedule_event(time(), 'twp_every_minute', 'twp_process_callbacks');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user