diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 324b71d..bd401ad 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,6 @@ +**5.1.1** *(Apr 21 2020)* +- Fixes records being overwritten after boot. This bug did not corrupt saves and is only a visual error. + **5.1.0** *(Apr 21 2020)* - Completely rebuilt the backend. This includes several optimizations, code cleanup and syncing fixes. Its code model now pairs nicely with the frontend's Javascript model. diff --git a/lib/servers.js b/lib/servers.js index 522681c..0ad6dd6 100644 --- a/lib/servers.js +++ b/lib/servers.js @@ -10,7 +10,6 @@ class ServerRegistration { constructor (data) { this.data = data this._pingHistory = [] - this._hasInitialRecordData = false } getUpdate (timestamp, resp, err, version) { @@ -27,14 +26,7 @@ class ServerRegistration { update.versions = this.versions } - // Validate that we have logToDatabase enabled otherwise in memory pings - // will create a record that's only valid for the runtime duration. - if (config.logToDatabase && (!this._hasInitialRecordData || !this.recordData || resp.players.online > this.recordData.playerCount)) { - // For instances with existing data, recordData will be defined at boot - // This causes initial updates to NOT include recordData since it hasn't changed - // This flag force includes it to avoid "late loading" - this._hasInitialRecordData = true - + if (config.logToDatabase && (!this.recordData || resp.players.online > this.recordData.playerCount)) { this.recordData = { playerCount: resp.players.online, timestamp: timestamp diff --git a/package-lock.json b/package-lock.json index 2cea2c2..9a497ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "minetrack", - "version": "5.0.0", + "version": "5.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ba9de37..b58efc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minetrack", - "version": "5.1.0", + "version": "5.1.1", "description": "A Minecraft server tracker that lets you focus on the basics.", "main": "main.js", "dependencies": {