binusgdc / VCPA

A Discord bot that records voice call participants' attendance
2 stars 4 forks source link

Phase out use of `global` #25

Closed istamarahsan closed 1 year ago

istamarahsan commented 1 year ago

Currently, global is used to handle dependencies on application state (ongoing sessions), persistence (log storage) and external services (push target).

It has served us well but it's time to take a more robust approach. All global components are mutable (var) by global's nature. It would be less error-prone to instead inject dependencies into the handlers and phase out of using global altogether. The highest priority items are things mutated often: ongoing sessions and most recent completed session.

500-internal-server-error commented 1 year ago

Resolved by commit 09d8347877c00270a011b2b9cc7c9eac8b36ec48.