-
-
Notifications
You must be signed in to change notification settings - Fork 605
Fix transcript generation and ticket claiming functionality issues #644
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
Open
subhampro
wants to merge
7
commits into
discord-tickets:main
Choose a base branch
from
subhampro:fix-transcript-and-claim-issues
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix transcript generation and ticket claiming functionality issues #644
subhampro
wants to merge
7
commits into
discord-tickets:main
from
subhampro:fix-transcript-and-claim-issues
Conversation
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
This commit addresses critical issues that were preventing proper transcript generation and ticket claiming functionality in the Discord ticket bot. Issues Resolved: 1. Empty Message History in Transcripts - Problem: Ticket transcripts displayed no conversation history - Cause: Production environments had message archiving disabled - Solution: Modified archiver to only disable archiving in development mode - Result: Complete conversation history now appears in transcripts 2. Incorrect Claim Status Display - Problem: Transcripts always showed 'not claimed' regardless of actual status - Cause: Claiming user information was not properly archived for transcript use - Solution: Enhanced claim process to archive user data with proper encryption - Result: Transcripts now correctly show who claimed each ticket 3. Database Errors During Ticket Claiming - Problem: Staff members encountered database constraint violations when claiming - Cause: Invalid database operations and improper user data handling - Solution: Implemented proper user archiving using direct database operations - Result: Ticket claiming now works without errors Technical Changes: - src/lib/tickets/archiver.js: Allow production message archiving - src/lib/workers/transcript.js: Enhanced claimed user lookup and decryption - src/lib/tickets/manager.js: Added proper user archiving during claim process Implementation Details: - Fixed OVERRIDE_ARCHIVE environment variable logic for production use - Added comprehensive user archiving with encryption during ticket claiming - Improved transcript worker to properly handle claimed user relationships - Maintained backward compatibility and existing functionality - Added proper error handling throughout the claiming process Testing Verified: - Bot starts successfully without syntax errors - Message archiving works correctly in production - Ticket claiming functions without database errors - Transcripts display complete conversation history - Claimed status shows correct staff member information Impact: This update transforms the ticket system into a fully functional support tool suitable for professional customer service environments, with reliable transcript generation and proper claim attribution.
This update improves the reliability of ticket operations by addressing two key areas: transcript generation and Discord API error management. Improvements Made: 1. Ticket Claiming Enhancement - Added automatic user archiving when staff claim tickets - Ensures claiming user information appears correctly in transcripts - Uses proper encryption for secure data storage - Prevents database constraint violations during claim operations 2. Feedback System Error Handling - Added graceful error handling for Discord API race conditions - Prevents 'Unknown Channel' and 'Unknown Message' errors - Maintains functionality when channels are deleted during ticket closure - Provides informative debug logging for troubleshooting Technical Changes: - Enhanced claim process in ticket manager to archive user data - Improved feedback modal with try-catch error handling - Added human-readable comments throughout the codebase - Maintained clean code structure with minimal changes Benefits: - Eliminates Discord API errors during ticket closure - Ensures accurate transcript generation with claim information - Provides better user experience with reliable ticket operations - Maintains system stability during high-volume ticket processing All functionality has been tested and verified to work correctly without breaking existing features or introducing new issues.
Enhanced the message deletion listener to prevent unnecessary warning messages about archived messages that don't exist. Changes: - Check if message exists in archive before attempting to update - Use debug logging for system messages that are never archived - Prevent 'Record to update not found' database errors - Maintain all existing functionality while reducing log noise This resolves the common warning messages about archived messages that cannot be marked as deleted, particularly for system messages that Discord automatically generates but are not stored in the archive.
eartharoid
reviewed
Jul 27, 2025
subhampro
commented
Jul 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I revert back the original code here !
Any other issues brother ? @eartharoid |
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 resolves critical functionality issues affecting transcript generation and ticket claiming in the Discord ticket bot that were preventing proper operation in production environments.
Issues Resolved
1. Empty Message History in Transcripts
2. Incorrect Claim Status Display
3. Database Constraint Violations During Claiming
Technical Implementation
Files Modified:
src/lib/tickets/archiver.js
: Enhanced archiving logic for production environmentssrc/lib/workers/transcript.js
: Improved claimed user lookup and data decryption processessrc/lib/tickets/manager.js
: Added comprehensive user archiving during ticket claim operationsKey Technical Changes:
Testing and Verification
Impact
This update transforms the ticket system into a fully operational support tool suitable for professional customer service environments, providing reliable transcript generation with complete conversation history and accurate claim attribution.
Versioning information
Is this related to an issue?
This addresses critical functionality issues that prevent proper transcript generation and ticket claiming operations in production environments.
Changes made
Confirmations