-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
heartbeatList different on page load #4035
Open
2 tasks done
Labels
area:core
issues describing changes to the core of uptime kuma
area:monitor
Everything related to monitors
bug
Something isn't working
Comments
It seems like the function sending the most recent 100 heartbeats in the "wrong" format is |
This did the trick. async function sendHeartbeatList(socket, monitorID, toUser = false, overwrite = false) {
let list = await R.getAll(`
SELECT * FROM heartbeat
WHERE monitor_id = ?
ORDER BY time DESC
LIMIT 100
`, [
monitorID,
]);
- let result = list.reverse();
+ let result = R.convertToBeans("heartbeat", list.reverse());
if (toUser) {
io.to(socket.userID).emit("heartbeatList", monitorID, result, overwrite);
} else {
socket.emit("heartbeatList", monitorID, result, overwrite);
}
} |
7 tasks
7 tasks
We are clearing up our old |
chakflying
added
bug
Something isn't working
area:monitor
Everything related to monitors
area:core
issues describing changes to the core of uptime kuma
and removed
help
Stale
labels
Feb 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:core
issues describing changes to the core of uptime kuma
area:monitor
Everything related to monitors
bug
Something isn't working
🛡️ Security Policy
📝 Describe your problem
If I log the last item in
this.$root.heartbeatList
, I get something different when the page loads versus every time after when a new heartbeat happens. It seems that the first one is just a raw dump of the database entries, whereas subsequent heartbeats appear to have called toJSON().As an example, I added a console.log() to chartData() in PingChart.vue (see below).
The result on page load is...
But after the next heartbeat...
This doesn't end up causing any issues for single word variable names, but does cause issues if you're trying to access variables like monitorID instead of monitor_id. I'm running into this issue while trying to add some slow response monitoring information to the GUI. As an example, I added a
ping_threshold
to the database, but the toJSON() returnspingThreshold
. I can get around the first one being different with the code below, but it feels a little hacky. Seems to me like something is going wrong with the first call, but I'm having trouble tracking it down. Any ideas? Or am I going about this incorrectly?📝 Error Message(s) or Log
No response
🐻 Uptime-Kuma Version
1.23.4
💻 Operating System and Arch
Linux Mint 21.2
🌐 Browser
Google Chrome 119.0.6045.105
🐋 Docker Version
No response
🟩 NodeJS Version
18.18.2
The text was updated successfully, but these errors were encountered: