Skip to content

Commit

Permalink
fix: use multiplexed file timestamps in deltas
Browse files Browse the repository at this point in the history
If the original delta data has timestamps use them, otherwise use the
timestamp of the multiplexed data also in deltas instead of letting the
server fill in the current time.

Fixes #1659.
  • Loading branch information
tkurki committed Dec 31, 2023
1 parent 4eeabc1 commit 91f0c6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/streams/autodetect.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ Splitter.prototype._transform = function (msg, encoding, _done) {
default:
try {
const parsed = JSON.parse(msg.data)
const timestamp = new Date(Number(msg.timestamp))
parsed.updates && parsed.updates.forEach((update) => update.timestamp = timestamp)
this.push(parsed)
this.demuxEmitData(parsed)
} catch (e) {
Expand Down

0 comments on commit 91f0c6e

Please sign in to comment.