2026 Code Clean Up #487
Labels
No labels
blocked
duplicate
needs
approval
needs
criteria
needs
estimate
needs
tests
question
type
admin
type
alert
type
bug
type
change
type
defect
type
epic
type
idea
type
incident
type
investigation
type
spike
type
story
wontfix
No project
No assignees
1 participant
Notifications
Total time spent: 12 minutes 54 seconds
Due date
Vylpes
12 minutes 54 seconds
No due date set.
Dependencies
No dependencies set.
Reference
External/card-drop#487
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scan the repository for areas of code which can be cleaned up and perhaps written a bit cleaner. Identify any major areas not covered by testing or documentation which should be.
Card Drop cleanup + coverage checklist
Actionable items from a 2026 repository scan. Check items off as they are completed.
Code cleanup
Rename misspelled
GuildMemebrUpdatetoGuildMemberUpdatesrc/contracts/EventExecutors.ts,src/client/client.ts,src/client/util.tsAwait async command / button / dropdown handlers in dispatchers
src/client/interactionCreate/Button.ts,src/client/interactionCreate/ChatInputCommand.ts,src/client/interactionCreate/StringDropdown.tsawait, so rejected promises bypass the surroundingtry/catch.await item.Event.execute(...)/await itemToUse.Command.execute(...).e as string; useAppLogger.CatchErroror similar).Throw
Errorobjects instead of bare stringssrc/bot.ts,src/client/appLogger.tsthrow "..."tothrow new Error("...")and keep logging consistent.Replace loose equality (
==/!=) with strict equality (===/!==)src/helpers/DropHelpers/GetUnclaimedCardsHelper.ts,src/helpers/InventoryHelper.ts,src/commands/sacrifice.ts,src/helpers/SeriesHelper.ts,src/helpers/TimerHelper.ts, and related helpers/commands that compare quantities/IDs.eqeqeqin ESLint, then fix remaining violations.Stop mutating source arrays during pagination
src/helpers/SeriesHelper.tssplicepage selection withsliceso cloned card lists are not mutated as a side effect.Stop swallowing image-generation errors
src/helpers/ImageHelper.tscatchwith a TODO currently drops failures. Capture the error, log it (or rethrow), and cover failure modes in tests.Fix
AppBaseEntity.FetchOneByIdrelations defaultsrc/contracts/AppBaseEntity.tsrelations || {}; TypeORM expects an array. Default torelations || [](same pattern asFetchAll).Harden timer tick execution
src/helpers/TimerHelper.tsonTickcallbacks and log tick failures.Add authentication to the reload webhook
src/webhooks.ts(POST /api/reload-db)Project metadata / dependency cleanup
package.jsonjest(and related test packages if appropriate) fromdependenciestodevDependencies.bugs.url(https//...→https://...).Testing gaps
Current Jest coverage is concentrated on drop/multidrop/effects commands, a subset of button events,
PurgeClaims, and a few helpers. Priority gaps:Add helper tests for uncovered helpers
src/helpers/InventoryHelper.tssrc/helpers/CardSearchHelper.tssrc/helpers/SeriesHelper.tssrc/helpers/DropHelpers/GetUnclaimedCardsHelper.tssrc/helpers/ImageHelper.tsAdd command tests for untested slash commands
daily,gdrivesync,give,inventory,resync,sacrifice,series,stats,trade,view,about,id, andstage/*.Add button-event tests for untested handlers
inventory,sacrifice,series,trade,view.Add string-dropdown coverage
src/stringDropdowns/Inventory.tsand dispatch path insrc/client/interactionCreate/StringDropdown.ts.Add webhook + middleware tests
src/webhooks.tssrc/client/interactionCreate/middleware/NewUserDiscovery.tsAdd timer coverage for
GiveCurrencysrc/timers/GiveCurrency.ts(onlyPurgeClaimsis tested today).Assert dispatcher error-handling after awaiting handlers
Documentation gaps
Expand README with developer ops
yarn test/yarn lint.db:upmention.POST /api/reload-db(and auth once added).Document how to add commands / button events / dropdown events
src/registry.tsand the interaction-create dispatchers so contributors know where to register new handlers.Cross-link existing docs to testing / env expectations
docs/cards.md,docs/google-drive-sync.md,docs/logger.mdshould reference where env vars live and what tests are expected when changing those areas.Suggested order of attack
await+ error logging (correctness).GuildMemebrUpdatetypo andAppBaseEntityrelations default.splicepagination and empty catch inImageHelper./api/reload-dband document it.inventory,sacrifice,trade,series,view).