-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[MM-57409] Notify error sharing on iOS #8408
base: main
Are you sure you want to change the base?
Conversation
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.
Additionally, what happens when:
- The use taps on the notification that was presented.
- The user has the application opened when the notification triggers
- Tap on the notification inside the app as shown in 2.
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.
Why the changes on this file?
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'll remove them, they were added by mistake
if let timeout = data.failTimeout, timeout < Date() { | ||
backgroundSession?.invalidateAndCancel() | ||
os_log( | ||
"Mattermost BackgroundSession: postMessageIfUploadFinished session %{public}@ timed out", | ||
session.configuration.identifier ?? "no identifier" | ||
) | ||
return | ||
} |
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.
shouldn't this be done after checking if the last file was actually uploaded? because if that is the case, this is cancelling the whole thing instead of just posting the message
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.
Yup! The reason is that we already told the user that the sharing failed due to a timeout. Since we can't control when this happens this could be a day later making things confusing. So we cancel the first opportunity we have
@@ -56,6 +61,7 @@ extension ShareExtension { | |||
filename, | |||
id | |||
) | |||
return "There was an error when trying to upload. Please try again" |
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.
before the other two returns you added a notifyFailureNow
call, but not here, why?
) | ||
} | ||
} | ||
|
||
// TODO: setup some configuration for allowing users to figure out the right ammount of time to wait. |
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 don't think we should allow the user to set this, we should come up with a number that makes sense.. maybe an hour or so
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.
That's cool with me too. O just didn't feel entitled to make a decision on either option
let NETWORK_ERROR_MESSAGE: String = "Mattermost App couldn't acknowledge the message was posted due to network conditions, please review and try again" | ||
let FILE_ERROR_MESSAGE: String = "The shared file couldn't be processed for sharing" |
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.
Ideally this would be localized. You can check the code in the Share Extension around the Views on how is done with the use of NSLocalizedString or String.localizedString.
|
||
func scheduleFailNotification(timeout: Double = SHARE_TIMEOUT, description: String = NETWORK_ERROR_MESSAGE) -> String { | ||
let failNotification = UNMutableNotificationContent() | ||
failNotification.title = "Share content failed" |
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.
this should also be localized.
for 1 and 3, it opens the app. |
Ticket: MM-57409
Approach to solve it:
Why such a complex approach:
Context:
Pending:
Checklist
E2E iOS tests for PR
.Device Information
iOS simulator
Screenshots
Release Note