File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,19 @@ private static function add_timestamp_and_ttl( $event ) {
110
110
// Add timestamp and ttl to onboarding_complete event
111
111
$ event ['data ' ]['timestamp ' ] = $ current_time ;
112
112
113
- // Calculate ttl from stored start time
113
+ // Use the same completion time that was stored in handle_completed()
114
+ $ completion_time = get_option ( Options::get_option_name ( 'completed_time ' ) );
114
115
$ start_time = get_option ( Options::get_option_name ( 'start_time ' ) );
116
+
115
117
if ( $ start_time ) {
116
- $ ttl_seconds = $ current_time - $ start_time ;
118
+ if ( $ completion_time ) {
119
+ // Use stored completion time
120
+ $ ttl_seconds = $ completion_time - $ start_time ;
121
+ } else {
122
+ // Fallback to current time if completion_time not found
123
+ $ ttl_seconds = $ current_time - $ start_time ;
124
+ }
125
+
117
126
if ( $ ttl_seconds >= 0 ) {
118
127
$ event ['data ' ]['ttl ' ] = $ ttl_seconds ;
119
128
}
You can’t perform that action at this time.
0 commit comments