feat/40-reroll-on-disinterest #54

Merged
kenobi merged 73 commits from feat/40-reroll-on-disinterest into master 2023-11-19 20:24:36 +01:00
Showing only changes of commit 5a6c66cb3e - Show all commits

View File

@ -1,5 +1,8 @@
import { createLogger, format, transports } from "winston"
import { config } from "./configuration"
import { v4 } from "uuid"
export const newRequestId = v4()
magnetotail marked this conversation as resolved Outdated

why?

why?

This is a complete and total, boneheaded error :D
The intention was to present an more memorizable way to get a new uuid/v4.
Instead this just sets it once, making it useless.
It should be an exported function, returning the output of v4() and the callsite would be
const requestId = newRequestId()
This would prevent the
import { v4 as uuid } from "uuid" or const requestId = v4() which, I think, are tedious or non-obvious.
If you think this is a bad idea, I will gladly revert it though :)

This is a complete and total, boneheaded error :D The _intention_ was to present an more memorizable way to get a new uuid/v4. Instead this just sets it once, making it useless. It _should_ be an exported function, returning the output of `v4()` and the callsite would be `const requestId = newRequestId()` This would prevent the `import { v4 as uuid } from "uuid"` or `const requestId = v4()` which, I think, are tedious or non-obvious. If you think this is a bad idea, I will gladly revert it though :)

I dont think it's bad tbh if we dont need the v4 as uuid import then. But I would also like an eventhandler framework where we would prevent usual boilerplate code like looking for guild Id or making a request id and put those base checks and things in a base class and just have handling code in a subclass. But that is quite hard as I learned

I dont think it's bad tbh if we dont need the v4 as uuid import then. But I would also like an eventhandler framework where we would prevent usual boilerplate code like looking for guild Id or making a request id and put those base checks and things in a base class and just have handling code in a subclass. But that is quite hard as I learned
export const noGuildId = 'NoGuildId'
const printFn = format.printf(({ guildId, level, message, errorCode, requestId, timestamp: logTimestamp }: { [k: string]: string }) => {