Open
Description
In the latest version, 3.21.4
, the Timestamp.toObject()
function isn't working correctly.
Previously it would return the timestamp as an object with keys for seconds
and milliseconds
. However now it is returning zero values for both.
This is a function where I noticed the issue, I've added some logging which pointed out toObject()
as being the problem.
function dateToTs(date: Date): Timestamp {
const ts = new Timestamp();
ts.fromDate(date);
console.log(
"date:",
date,
"timestamp:",
ts.getSeconds(),
ts.getNanos(),
ts.toObject(),
);
return ts;
}
See the screenshot below for the resulting console log, where you can see the seconds and milliseconds are set, but the toObject
return is zeroed
Activity