From 1fcc5eccb17bdb0021f66e2832541e9c87a6aeb4 Mon Sep 17 00:00:00 2001 From: Akshay Rana Date: Mon, 17 Oct 2022 12:44:44 +0530 Subject: [PATCH 1/4] updated timestamp format to ISO string in realtime payload --- app/realtime.php | 4 ++-- src/Appwrite/Messaging/Adapter/Realtime.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/realtime.php b/app/realtime.php index be87c3d6e6..0b1d992922 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -237,7 +237,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, 'data' => [ 'events' => ['stats.connections'], 'channels' => ['project'], - 'timestamp' => DateTime::now(), + 'timestamp' => date('c'), 'payload' => [ $projectId => $payload[$projectId] ] @@ -264,7 +264,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, 'data' => [ 'events' => ['test.event'], 'channels' => ['tests'], - 'timestamp' => DateTime::now(), + 'timestamp' => date('c'), 'payload' => $payload ] ]; diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index 9151a5c0b5..c595c394e4 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -149,7 +149,7 @@ class Realtime extends Adapter 'data' => [ 'events' => $events, 'channels' => $channels, - 'timestamp' => DateTime::now(), + 'timestamp' => date('c'), 'payload' => $payload ] ])); From c08f2e65e6e0fa201d8584483caa814ef5212f83 Mon Sep 17 00:00:00 2001 From: Akshay Rana Date: Tue, 18 Oct 2022 22:22:01 +0530 Subject: [PATCH 2/4] Updated timestamp format Co-authored-by: Steven <1477010+stnguyen90@users.noreply.github.com> --- src/Appwrite/Messaging/Adapter/Realtime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index c595c394e4..91b2e5e267 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -149,7 +149,7 @@ class Realtime extends Adapter 'data' => [ 'events' => $events, 'channels' => $channels, - 'timestamp' => date('c'), + 'timestamp' => DateTime::formatTz(DateTime::now()), 'payload' => $payload ] ])); From 641a4af8d460361cbda5d8ab9bda6246d1c152a2 Mon Sep 17 00:00:00 2001 From: Akshay Rana Date: Tue, 18 Oct 2022 22:40:50 +0530 Subject: [PATCH 3/4] upated the timestamp code --- app/realtime.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/realtime.php b/app/realtime.php index 0b1d992922..595f43b48f 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -237,7 +237,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, 'data' => [ 'events' => ['stats.connections'], 'channels' => ['project'], - 'timestamp' => date('c'), + 'timestamp' => DateTime::formatTz(DateTime::now()), 'payload' => [ $projectId => $payload[$projectId] ] @@ -264,7 +264,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, 'data' => [ 'events' => ['test.event'], 'channels' => ['tests'], - 'timestamp' => date('c'), + 'timestamp' => DateTime::formatTz(DateTime::now()), 'payload' => $payload ] ]; From 58c4c3da1e6a0229b380f98188faa53587fd1590 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 20 Jan 2023 09:52:11 +0000 Subject: [PATCH 4/4] feat: update changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 5103e39a11..a6fa76fff7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ # Version 1.2.1 ## Bugs - Fix a few null safety warnings [#4654](https://github.com/appwrite/appwrite/pull/4654) +- Fix timestamp format in Realtime response [#4515](https://github.com/appwrite/appwrite/pull/4515) # Version 1.2.0 ## Features