fix: likes follow-ups #256, #257, #260#261
Conversation
- #256: Replace String.to_existing_atom with explicit whitelist in LikeNormalizer to avoid crashes on checkpoint replay with renamed fields - #257: Add 45-day pruning of old unliked entries in SnapshotLike, matching the subscription aggregate pattern - #260: Support is_public option in popularity test helpers so private users increment likes count without appearing in likes_people Closes #256, closes #257, closes #260 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review — PR #261 (likes follow-ups #256, #257, #260)Overall: APPROVED — the three issues are well addressed, code follows existing patterns, and tests are solid. A few minor observations below. #256 — LikeNormalizer whitelistLGTM. Replacing One small note: the #257 — 45-day pruning in
|
| Item | Status |
|---|---|
LikeNormalizer whitelist (#256) |
✅ LGTM |
| 45-day pruning logic (#257) | ✅ LGTM |
Missing comment on nil liked_at fallback |
NICE-TO-HAVE |
Missing edge-case test (unliked_at == liked_at) |
NICE-TO-HAVE |
is_public opt for popularity helpers (#260) |
✅ LGTM |
| Issue #258 TODO traceability | NICE-TO-HAVE |
No MUST-FIX or SHOULD-FIX items — safe to merge.
🤖 Claude Code review
- Add clarifying comment on nil liked_at fallback in filter_old_unlikes - Add edge-case test: unliked_at == liked_at is preserved (not pruned) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review — PR #261 (likes follow-ups #256, #257, #260)Overall: APPROVED — all three follow-up issues are properly resolved with solid tests and no MUST-FIX or SHOULD-FIX items. #256 — LikeNormalizer whitelistLGTM. The One thing to be aware of for future developers: when a new field is added to like data maps (e.g. a new metadata field), this whitelist in #257 — 45-day pruning in
|
| Item | Status |
|---|---|
| LikeNormalizer whitelist (#256) | ✅ LGTM |
| Whitelist update guidance in moduledoc | NICE-TO-HAVE |
| 45-day pruning logic (#257) | ✅ LGTM |
nil liked_at fallback comment |
NICE-TO-HAVE |
Enum.into(%{}) vs Map.new() style |
NICE-TO-HAVE |
unliked_at == liked_at edge-case test |
✅ Present (contrary to previous review) |
is_public opt for popularity helpers (#260) |
✅ LGTM |
| Issue #258 | ✅ Correctly closed as documented |
No MUST-FIX or SHOULD-FIX items — safe to merge.
🤖 Claude Code review
- Add whitelist update guidance comment in LikeNormalizer
- Use Map.new() instead of Enum.into(%{}) for consistency
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Fixes three follow-up issues from the likes PR #255:
String.to_existing_atomwith an explicit whitelist inLikeNormalizer— unknown keys are dropped silently instead of crashing on checkpoint replay if a field is ever renamedSnapshotLike, matching the subscription aggregate pattern — entries withunliked_atolder than 45 days are pruned from snapshotsis_publicoption to popularity test helpers so private users can be tested — incrementslikescount without appearing inlikes_peopleAlso closes #258 (documented as inherent snapshot pattern limitation, TODO in code).
Test Plan
Closes #256, closes #257, closes #260