Implement Granular Webhook Controls & Refactor to OOP#8
Open
leecurrent04 wants to merge 19 commits into
Open
Conversation
delete console.log for embed
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.
This pull request introduces a major new feature allowing for granular, action-level control over webhook notifications. It also includes a significant architectural refactor of the event handling system to support this new functionality and improve code maintainability and extensibility.
🚀 New Feature: Granular Webhook Controls
Users are no longer limited to subscribing to all events of a certain type. They can now choose specific actions (create, change, delete) for each entity (User Story, Task, etc.) they want to receive notifications for.
🛠️ Architectural Refactor: OOP Event Handlers
The event handling system has been refactored from individual functions to an object-oriented (OOP) model.
Base EventHandler Class: A new EventHandler base class (src/lib/eventHandlers/eventHandler.ts) has been introduced to house common logic for creating embeds, processing diffs, and handling event data. This reduces code duplication and provides a clear, extensible pattern.
Specific Handler Classes: All individual event handlers (UserStoryHandler, TaskHandler, etc.) have been converted to classes that extend the new base class.
⚙️ Other Improvements & Fixes
Intelligent Comment Handling: New comments, which Taiga reports as a change action, are now intelligently re-classified as a create action on the backend. This allows users to subscribe to new comments separately from other updates.
API Robustness: Added a safeguard to automatically truncate embed field values that exceed Discord's 1024-character limit, preventing webhook send failures.
Dependency Upgrades: Upgraded key dependencies, including Next.js, and added the crypto package for more explicit handling.
Enhanced Documentation: The README.md has been significantly updated with setup images and more detailed instructions for a better developer onboarding experience