-
Notifications
You must be signed in to change notification settings - Fork 297
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
Communication
: Fix an issue that stops channels from loading messages
#9745
Communication
: Fix an issue that stops channels from loading messages
#9745
Conversation
WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
src/main/webapp/app/shared/metis/posting-header/posting-header.directive.ts (1)
98-101
: Consider adding a comment explaining the fallback behavior.For better maintainability, consider adding a comment explaining why we default to 'student' authority when handling deleted users.
} else { + // Default to student authority for deleted users to maintain UI consistency this.userAuthority = 'student'; this.userRoleBadge = 'artemisApp.metis.userRoles.deleted'; this.userAuthorityTooltip = 'artemisApp.metis.userAuthorityTooltips.deleted'; }
src/main/webapp/i18n/en/metis.json (1)
151-152
: Consider enhancing the tooltip message.While the tooltip follows the correct format, its message "Deleted: This user was deleted." is redundant. Consider providing more context about what this means for the communication channel.
- "deleted": "Deleted: This user was deleted." + "deleted": "Deleted: This user's account has been removed but their messages are preserved."
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
src/main/webapp/app/shared/metis/posting-header/posting-header.directive.ts
(1 hunks)src/main/webapp/i18n/de/metis.json
(1 hunks)src/main/webapp/i18n/en/metis.json
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/webapp/app/shared/metis/posting-header/posting-header.directive.ts (1)
src/main/webapp/i18n/de/metis.json (1)
Pattern src/main/webapp/i18n/de/**/*.json
: German language translations should be informal (dutzen) and should never be formal (sietzen). So the user should always be addressed with "du/dein" and never with "sie/ihr".
🔇 Additional comments (4)
src/main/webapp/app/shared/metis/posting-header/posting-header.directive.ts (1)
98-101
: LGTM! The implementation handles deleted users gracefully.
The new else branch appropriately handles the case of deleted users by setting default values and using translation keys, which aligns with the PR objective of fixing the communication channel loading issue.
Let's verify that the translation keys exist in both language files:
✅ Verification successful
Translation keys are properly implemented in both language files
The implementation is fully supported by the translation system:
artemisApp.metis.userRoles.deleted
exists in both English ("Deleted") and German ("Gelöscht")artemisApp.metis.userAuthorityTooltips.deleted
exists in both English ("Deleted: This user was deleted.") and German ("Gelöscht: Nutzer:in wurde gelöscht.")
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that the translation keys for deleted users exist in both language files
# Expected: Both translation keys should be present in both language files
echo "Checking English translations..."
rg "userRoles.deleted|userAuthorityTooltips.deleted" src/main/webapp/i18n/en/metis.json
echo "Checking German translations..."
rg "userRoles.deleted|userAuthorityTooltips.deleted" src/main/webapp/i18n/de/metis.json
Length of output: 327
Script:
#!/bin/bash
# Let's first check if the translation files exist and their content
echo "Checking if translation files exist..."
fd "metis.json" src/main/webapp/i18n
echo -e "\nChecking content of English translations..."
cat src/main/webapp/i18n/en/metis.json 2>/dev/null | jq -r '.artemisApp.metis | select(.) | {userRoles, userAuthorityTooltips}'
echo -e "\nChecking content of German translations..."
cat src/main/webapp/i18n/de/metis.json 2>/dev/null | jq -r '.artemisApp.metis | select(.) | {userRoles, userAuthorityTooltips}'
Length of output: 1611
src/main/webapp/i18n/en/metis.json (2)
145-146
: LGTM! Clear and consistent role definition.
The new "deleted" user role entry follows the existing pattern and provides a clear label for deleted users, which is essential for fixing the communication channel loading issue.
145-152
: Verify German translations exist.
Since the PR mentions translations in both English and German, let's verify that corresponding translations exist in the German localization file.
✅ Verification successful
Let me verify the complete context by checking both files side by side.
German translations are complete and consistent
The German translations for both user authority roles and tooltips are properly implemented and match their English counterparts:
- All roles (instructor, tutor, student, deleted) have corresponding translations
- All tooltips are properly translated with equivalent meaning and context
- Gender-inclusive language is appropriately used in German (e.g., "Tutor:in", "Studierende:r")
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for corresponding German translations
# Expected: Should find matching entries in the German translation file
# Check for the deleted user role and tooltip in the German translation file
rg -A1 '"deleted":' "src/main/webapp/i18n/de/metis.json"
Length of output: 364
Script:
#!/bin/bash
# Get the complete userAuthority section from both files for comparison
echo "=== English translations ==="
rg -A4 '"userAuthority": \{' "src/main/webapp/i18n/en/metis.json"
echo -e "\n=== German translations ==="
rg -A4 '"userAuthority": \{' "src/main/webapp/i18n/de/metis.json"
echo -e "\n=== English tooltips ==="
rg -A4 '"userAuthorityTooltips": \{' "src/main/webapp/i18n/en/metis.json"
echo -e "\n=== German tooltips ==="
rg -A4 '"userAuthorityTooltips": \{' "src/main/webapp/i18n/de/metis.json"
Length of output: 1368
src/main/webapp/i18n/de/metis.json (1)
145-146
: LGTM! The translations are well-implemented.
The new translations for deleted users are:
- Consistent with existing translation style
- Use appropriate gender-inclusive language
- Clear and concise in conveying the user's deleted status
Also applies to: 151-152
src/main/webapp/app/shared/metis/posting-header/posting-header.directive.ts
Show resolved
Hide resolved
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.
code looks good, but for some reason I can't reproduce the issue on a test server (Ts3) It seems that viewing a channel where a deleted user posted on works on other branches too. Am I missing something, or is the issue somewhere else?
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.
Tested on TS3, first without deployement and the random channel loaded indefinitely and the console showed errors. With deployment channel loads, and the messages are shown with the user "Deleted User"
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.
Lgtm
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.
Changes look good to me!
Great work!
Communication
: Fix issue that stops communication channel from loading messagesCommunication
: Fix an issue that stops channels from loading messages
Checklist
General
Client
Motivation and Context
Currently, when entering a channel where a user wrote messages and later the user was deleted, the module throws an error and will not load. This makes the channel completely unusable for all other users.
Description
I fixed the issue by adding the edge case to the posting header component that caused the errors. The error was caused by the tranlate directive getting an undefined key.
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Code Review
Manual Tests
Test Coverage
Screenshots
Before:
After:
Summary by CodeRabbit
New Features
Bug Fixes