-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notification: remove DestType and Dest #4022
Merged
Merged
Conversation
This file contains 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
- Changed notification.DestType to string for code simplicity - Updated all related function signatures and usages
- Consolidated enable/disable SQL queries - Updated methods to use destination-based enable/disable functions - Simplified contact method parameters to use unified structure
- Simplified destination handling by using gadb.DestV1 - Removed redundant notification package dependency - Introduced NewDestV1 constructor for gadb.DestV1 - Updated all IsKnownDest method signatures accordingly
- Migrate notification handling to use gadb.DestV1 - Update SQL queries to utilize unified UserContactMethod struct - Simplify destination hash generation for consistency - Ensure database functions properly handle unified structure for DestV1
Corrects the parameter used to fetch the original message status by using the destination's ID directly, ensuring accurate lookups.
- Remove `FormatDestValue` to simplify codebase - Standardize usage of `gadb.DestV1` across notification types - Clean up redundant imports and function code - Update Slack and Twilio destination registration types - Modify tests to use new destination type functions
- Use specific argument keys instead of general value for email, Slack, SMS, and webhook destinations - Adjust logic for Slack direct messages to use user ID instead of channel ID - Improve type checking for Twilio SMS destinations
- Updated Slack user group sender to use new destination argument methods - Adjusted Twilio voice sender to utilize destination arguments - Simplified test code by using new destination constructor functions Rationale: Enhance code readability and maintainability by standardizing how destination attributes are accessed.
- Unified destination value handling across different modules for better code clarity and consistency - Added function to convert contact methods to destination objects - Removed redundant destination type formatting calls
- Replace generic notification types with specific Twilio and email types - Adjust related throttle configuration and test functions to use strings instead of enums for destination types
- Replaced DestType instances with string type for simplicity - Removed unnecessary type conversion methods and functions - Updated tests and related imports to reflect string destination type usage
- Simplified message destination structure. - Consolidated SQL queries to use coalesced `dest` field. - Enhanced readability and maintainability of tests by using helper functions. - Updated graphical logging to directly use `DestV1`.
- Updates the ProviderType field to string to ensure consistent log data formatting.
- Delete destcompat.go as it duplicates functionality - Move necessary type definitions to desttype.go
- Replace DestHash with DestID for clarity - Simplify destination generation by removing redundant dependencies - Update tests and documentation to reflect changes - Consolidate destination types into gadb package
KatieMSB
approved these changes
Jul 31, 2024
allending313
approved these changes
Jul 31, 2024
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.
Description:
Removes the Dest struct and DestType type in favor of discrete params on the Message struct of DestID and Dest (gadb.DestV1).