Conversation
00c9459 to
4d21988
Compare
PR Review: Archiving FeedbackOverall the implementation is clean and well-tested. One bug worth fixing before merge. 🟡 Potential BugsDuplicate activity log entries on repeated calls
// toggle-archived.ts handler - no guard before logging
feedback.deletedAt = archived ? new Date() : null
createGameActivity(em, {
type: archived
? GameActivityType.GAME_FEEDBACK_ARCHIVED
: GameActivityType.GAME_FEEDBACK_RESTORED,
...
})Fix: bail out early (or skip the activity) when state is unchanged: const alreadyArchived = feedback.deletedAt !== null
if (archived === alreadyArchived) {
return { status: 200, body: { feedback } }
}🔵 Minor
.andWhere(withDeleted ? {} : { deletedAt: null })Passing an empty object to if (!withDeleted) {
query.andWhere({ deletedAt: null })
}Test CoverageNo issues — the new test file covers permissions, not-found, archive, restore, anonymised players, and activity log content. The list tests for the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #874 +/- ##
===========================================
+ Coverage 97.00% 97.03% +0.02%
===========================================
Files 388 389 +1
Lines 6139 6163 +24
Branches 785 790 +5
===========================================
+ Hits 5955 5980 +25
+ Misses 95 94 -1
Partials 89 89 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4d21988 to
f15e83a
Compare
f15e83a to
a4238d6
Compare
No description provided.