-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Render M_SAFETY errors (MSC4387) #31558
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
base: develop
Are you sure you want to change the base?
Changes from 46 commits
7d92f0c
1fde8bf
c595acc
3270e87
73f157d
1d1a8a8
2f1d28b
7f0306f
6638f2f
9191346
1571360
e449a9d
7ce4f49
c799ee2
29b787a
6cc9e3e
3168186
335498d
c3bcc54
e6aca3f
1b744d0
6fe5109
bec3a3b
ecc4671
847cc91
768a731
5c5f899
401383a
5fdf04f
72cb271
22b68bf
940f5be
73d21b1
14e1f97
39a9d52
f58da18
3a76a99
74b78bf
16eb46f
224ebb8
4d0f9a3
acb4583
b5b2aad
823814a
1d70933
7b76628
ef8bf8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,3 +103,65 @@ export const WithLocalRoomRetry = Template.bind({}); | |
| WithLocalRoomRetry.args = { | ||
| state: RoomStatusBarState.LocalRoomFailed, | ||
| }; | ||
|
|
||
| /** | ||
| * Rendered when a message was rejected by the server, and cannot be reattempted. | ||
| */ | ||
| export const WithMessageRejected = Template.bind({}); | ||
| WithMessageRejected.args = { | ||
| state: RoomStatusBarState.MessageRejected, | ||
| harms: ["org.matrix.msc4387.harassment"], | ||
| }; | ||
|
|
||
| /** | ||
| * Rendered when a message was rejected by the server, and can be reattempted later. | ||
| */ | ||
| export const WithMessageRejectedCanRetryInTime = Template.bind({}); | ||
| WithMessageRejectedCanRetryInTime.args = { | ||
| state: RoomStatusBarState.MessageRejected, | ||
| onResendAllClick: undefined, | ||
| canRetryInSeconds: 5, | ||
| harms: [], | ||
| isResending: false, | ||
| }; | ||
|
|
||
| /** | ||
| * Rendered when a message was rejected by the server, and can be reattempted. | ||
| */ | ||
| export const WithMessageRejectedCanRetry = Template.bind({}); | ||
| WithMessageRejectedCanRetry.args = { | ||
| state: RoomStatusBarState.MessageRejected, | ||
| harms: [], | ||
| isResending: false, | ||
| }; | ||
|
|
||
| /** | ||
| * Rendered when a message was rejected by the server, and is being resent. | ||
| */ | ||
| export const WithMessageRejectedSending = Template.bind({}); | ||
| WithMessageRejectedSending.args = { | ||
| state: RoomStatusBarState.MessageRejected, | ||
| harms: [], | ||
| isResending: true, | ||
| }; | ||
|
|
||
| /** | ||
| * Rendered when a message was rejected by the server, and we use the generic message. | ||
| */ | ||
| export const WithMessageRejectedWithKnownHarm = Template.bind({}); | ||
| WithMessageRejectedWithKnownHarm.args = { | ||
| state: RoomStatusBarState.MessageRejected, | ||
| harms: ["org.matrix.msc4387.spam"], | ||
| isResending: false, | ||
| }; | ||
|
|
||
| /** | ||
| * Rendered when a message was rejected by the server with a specific message. | ||
| */ | ||
| export const WithMessageRejectedWithServerMessage = Template.bind({}); | ||
| WithMessageRejectedWithServerMessage.args = { | ||
| state: RoomStatusBarState.MessageRejected, | ||
| harms: ["any.old.harm"], | ||
| serverError: "OurServer rejects this content", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just the error the server is returning. I think the MSC says that if the harm isn't known, we should defer to the server's message?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We shouldn't be showing untranslated server errors ever, this violates some customer commitments we have to be fully i18nable
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted, I'll leave feedback on the MSC. It doesn't appear to be a must so we can use generic wording for this. |
||
| isResending: false, | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.