Skip to content

fix: store suggestion ID in data for correct syncSuggestions deduplication#2184

Open
AndreiAlexandruParaschiv wants to merge 1 commit intomainfrom
offsite_reddit
Open

fix: store suggestion ID in data for correct syncSuggestions deduplication#2184
AndreiAlexandruParaschiv wants to merge 1 commit intomainfrom
offsite_reddit

Conversation

@AndreiAlexandruParaschiv
Copy link
Copy Markdown
Contributor

@AndreiAlexandruParaschiv AndreiAlexandruParaschiv commented Mar 23, 2026

Summary

  • Fixes Reddit and YouTube guidance handlers to store the original suggestion ID inside the data payload (redditSuggestionId / youtubeSuggestionId)
  • Updates buildKey to prefer the stored ID over the top-level id

Root cause: syncSuggestions calls buildKey(s.getData()) for existing records, but getData() returns only the data sub-object which lacks the suggestion id field. This caused all existing keys to resolve to reddit::undefined (or youtube::undefined), marking every suggestion as OUTDATED on every re-run and creating duplicates.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant