stacker.news icon indicating copy to clipboard operation
stacker.news copied to clipboard

Filter push notifications using satsFilterClause in SQL

Open pory-gone opened this issue 1 month ago • 0 comments

Description

fix #2438

Added satsFilter check to push notification queries. Changes:

  • Added satsFilterClause() helper function that replicates the logic from investmentClause in item.js -Modified notifyUserSubscribers, notifyTerritorySubscribers, notifyThreadSubscribers, notifyItemParents, notifyMention, and notifyItemMention to filter based on satsFilter directly in the SQL queryy

Screenshots

N/A

Additional Context

The filter is applied at the SQL query level rather than in sendUserNotification to ensure the filter is applied before notification.itemId is deleted. I haven't been able to test properly with the freebies since they've been disabled, but tests show the filter works.

Checklist

Are your changes backward compatible? Please answer below: Yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below: 7/10

For frontend changes: Tested on mobile, light and dark mode? Please answer below: NaN

Did you introduce any new environment variables? If so, call them out explicitly here: NaN

Did you use AI for this? If so, how much did it assist you? AI ​​helped me with a detailed explanation of the code and a testing plan to verify that the changes worked correctly.

pory-gone avatar Dec 12 '25 19:12 pory-gone