Skip to content

fix(watchlist): normalize and dedupe persisted ids#1301

Closed
jony376 wants to merge 2 commits into
entrius:testfrom
jony376:fix/watchlist-normalize-dedupe-v2
Closed

fix(watchlist): normalize and dedupe persisted ids#1301
jony376 wants to merge 2 commits into
entrius:testfrom
jony376:fix/watchlist-normalize-dedupe-v2

Conversation

@jony376

@jony376 jony376 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Normalize and dedupe persisted watchlist IDs across all categories to prevent inflated badge counts and inconsistent watched-state behavior.

Changes

  • Added ID normalization (trim + dedupe + empty removal) in watchlist storage read path.
  • Applied normalization in V1->V2 migration path.
  • Enforced normalization in add/toggle write paths to avoid future duplicate drift.
  • Normalized starred PR keys in watched PR source filtering.

Related Issues

Closes #1300

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe):

Testing

  • npm run build passes
  • Manual browser smoke test

Not run locally in this pass.

Checklist

  • Self-reviewed the diff
  • Follows existing code patterns and naming
  • No unrelated changes included
  • Documentation updated if behavior changed

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 31, 2026
@anderdc

anderdc commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

The add/toggle paths already block duplicates via the existing includes() guard, and every watchlist id comes from structured API data — repo full names, hotkeys, serialized PR keys — that carries no whitespace. The duplicate/whitespace state this normalizes is only reachable by hand-editing localStorage, which is exactly the reproduction in #1300. No real-world path produces the drift. Closing.

@anderdc anderdc closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize and dedupe watchlist ids across persisted categories

2 participants