-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Store timestamp in the log #2732
Conversation
So that the data can be accessed without needing the folder structure.
And then I have a question about L1045/1048: let tier = this.format.toLowerCase().replace(/[^a-z0-9]+/g, ''); Shouldn't this just be |
Sorry--been coding in python too long.
Can we remove some redundant data while we're at it? |
A lot of fields in p1rating/p2rating are superfluous. The individual formatid's and entryids, for one. |
That would be fine with me, but I'm not sure how to do it in a future-proofed way (say the colname in the db changes, then |
Or if you're worried about space, you could always just tackle #2733 |
You're cute when talking about languages you don't know. There's not a single language for which it's impossible to delete a key from a map if you're not sure if the key exists. Every language at the very least has a "does this key exist?" function (except ObjC for some weird reason). Anyway, |
@Zarel, as I said, I don't know how to do it in JS. I never said it wasn't possible to do it. But let's identify the redundant keys: That would be:
And if we don't care about future-proofing, we can ditch
Does js have a "delete all" or do you just have to iterate? |
Iterate. I'm fine with all of the above, although keeping |
@@ -1037,6 +1037,9 @@ let BattleRoom = (() => { | |||
logData.endType = this.battle.endType; | |||
if (!p1rating) logData.ladderError = true; | |||
const date = new Date(); | |||
logData.timestamp = date; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, JSON doesn't support storing dates. It will toJSON
the date, which I believe makes it a string. Is that what you want, or do you want a numeric timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm fine with strings. In theory this could introduce TZ issues, but I'd rather have readability. If you care, I'm fine with numeric, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but you should probably do the conversion explicitly new Date().toString()
, so future people who read your code know that it's intentional and not accidental.
Resolves #2731
So that the data can be accessed without needing the folder structure.