Feat/settings flow#238
Merged
Merged
Conversation
Adds IUserNotificationPreferencesRepository interface and UserNotificationPreference entity to the interfaces file, then implements the repository with findByUser, upsertMany (insert-or-update via onConflict merge), and filterActiveUsers (missing row = enabled, only is_active=false rows are excluded). 13 unit tests cover all methods and edge cases with 100% statement/branch coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements GET and POST /users/by-channel/:channel/:channelUserId/notification-preferences endpoints with Zod schema validation, handler, and controller. Wires SettingsService and UserNotificationPreferencesRepository into the App bootstrap. Adds @notification-system/messages as a workspace dependency to fix the missing module error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add optional triggerType parameter to getDaoSubscribers across the service, handler, controller, and schema layers so callers can filter subscribers to only those who have the given notification type enabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ration x3 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NewProposalTriggerHandler, NewOffchainProposalTriggerHandler, and ProposalFinishedTriggerHandler now pass their respective triggerType strings to getSubscribers, enabling per-user preference filtering. Updated all affected test assertions accordingly, and fixed a pre-existing test bug in offchain-vote-cast where buildExpectedMessage was missing the address placeholder substitution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updated VoteConfirmationTriggerHandler, OffchainVoteCastTriggerHandler, and VotingPowerTriggerHandler to pass triggerType to all getWalletOwnersBatch, getSubscribers, and getDaoSubscribers calls, enabling per-notification-type preference filtering for hybrid handlers. Updated test expectation to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ng + VotingReminder handlers - Add optional `triggerType` param to `prepareBatchData` and forward it to `getWalletOwnersBatch` and `getDaoSubscribers` - Add `triggerType` as 3rd parameter to `sendBatchNotifications` (between `daoId` and `eventIdGenerator`) - NonVotingHandler passes `'non-voting'` as triggerType to `sendBatchNotifications` - VotingReminderTriggerHandler accepts `triggerType` in `processReminderEvent` and passes `message.triggerId` from `handleMessage` - Update test assertions to reflect new triggerType arguments Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add triggerType assertions to 4 handler test files (new-offchain-proposal, offchain-vote-cast, vote-confirmation, voting-power-changed) and create a NOTIFICATION_TYPES safety net test to ensure all dispatcher handler IDs have matching entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The subscription-server App constructor now requires settingsController, but the integration test setup was not passing it. Also added user_notification_preferences to the database cleanup list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| windowSize: number = DEFAULT_WINDOW_SIZE | ||
| ) { | ||
| super(TRIGGER_ID_PREFIX, interval); | ||
| super(`${TRIGGER_ID_PREFIX}-${thresholdPercentage}`, interval); |
Member
Author
There was a problem hiding this comment.
On the checkboxes, make sure that all the string is readable
pikonha
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add user notification preferences (settings) allowing users to choose which notification types they receive, and add support for offchain vote cast notifications. The settings flow is available via Telegram and Slack bots, backed by a new
user_notification_preferencesdatabase table and API endpoints. The dispatcher now filters subscribers bytriggerTypeso users only receive notifications they've opted into.Changes
/settingscommand and interactive settings flow for both Telegram (toggle grid) and Slack (checkbox list), built on a sharedBaseSettingsServicesettings.controller,settings.handler,settings.service, andUserNotificationPreferencesrepository in subscription-server withGETandPUTendpointsuser_notification_preferencestable to store per-user trigger-type opt-in/out preferencesgetSubscribers,getDaoSubscribers,getWalletOwners, and batch methods across the dispatcher and subscription-client to propagate and filter bytriggerTypelearn_more_settingsaction now opens the settings flow