Skip to content

Commit

Permalink
store internal timestamp as well as rx timestamp so read state can be…
Browse files Browse the repository at this point in the history
… based off internal timestamp
  • Loading branch information
liamcottle committed Nov 19, 2024
1 parent 4f44f0a commit a2f4b87
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/js/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ async function initDatabase(nodeId) {
timestamp: {
type: 'integer',
},
rx_timestamp: {
type: 'integer',
},
acked_by_node_id: {
type: 'integer',
},
Expand Down Expand Up @@ -97,6 +100,9 @@ async function initDatabase(nodeId) {
timestamp: {
type: 'integer',
},
rx_timestamp: {
type: 'integer',
},
},
}
},
Expand Down Expand Up @@ -132,7 +138,8 @@ class Message {
from: data.from,
channel: data.channel,
data: data.data,
timestamp: data.rxTime.getTime(),
timestamp: Date.now(),
rx_timestamp: data.rxTime.getTime(),
acked_by_node_id: null,
error: null,
});
Expand Down Expand Up @@ -296,7 +303,8 @@ class TraceRoute {
from: data.from,
channel: data.channel,
data: data.data,
timestamp: data.rxTime.getTime(),
timestamp: Date.now(),
rx_timestamp: data.rxTime.getTime(),
});
}

Expand Down

0 comments on commit a2f4b87

Please sign in to comment.