Skip to content

Commit 817de86

Browse files
authored
Fix local server timestamp handling on 32-bit architectures (#939)
* Fix RTDB 32-bit bug * Update readme * Format code.
1 parent 0028e79 commit 817de86

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

database/src/desktop/core/server_values.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ static const char kNameSubkeyServerValue[] = ".sv";
2828

2929
Variant GenerateServerValues(int64_t server_time_offset) {
3030
Variant server_values = Variant::EmptyMap();
31-
int64_t corrected_time = time(nullptr) * 1000L + server_time_offset;
31+
int64_t corrected_time =
32+
static_cast<int64_t>(time(nullptr)) * 1000L + server_time_offset;
3233
server_values.map()["timestamp"] = Variant::FromInt64(corrected_time);
3334
return server_values;
3435
}

release_build_files/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,8 @@ code.
584584
the Google-Mobile-Ads-SDK Cocoapod, "7.69.0-cppsdk2", to maintain
585585
compatibility with version 9.x of the Firebase iOS SDK.
586586
- Analytics: Removed deprecated event names and parameters.
587+
- Realtime Database (Desktop): Fixed a bug handling server timestamps
588+
on 32-bit CPUs.
587589
- Storage (Desktop): Set Content-Type HTTP header when uploading with
588590
custom metadata.
589591

0 commit comments

Comments
 (0)