Skip to content
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

Fix MM 56723 #7883

Merged
merged 11 commits into from
Apr 24, 2024
Merged

Fix MM 56723 #7883

merged 11 commits into from
Apr 24, 2024

Conversation

larkox
Copy link
Contributor

@larkox larkox commented Mar 26, 2024

Summary

Fix MM 56723

Ticket Link

Fix https://mattermost.atlassian.net/browse/MM-56723

Related PRs:

Push Proxy: mattermost/mattermost-push-proxy#119
Server: mattermost/mattermost#26643

Release Note

NONE

@larkox larkox added 2: Dev Review Requires review by a core commiter Do Not Merge Should not be merged until this label is removed 3: Security Review Review requested from Security Team labels Mar 26, 2024
@larkox larkox requested review from jupenur and enahum March 26, 2024 17:10
Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left dome comments and questions, but overall looks to be in the right direction

ios/Mattermost.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
if #available(iOSApplicationExtension 15.0, *) {
os_log(OSLogType.default, "Mattermost Notifications: creating invalid intent")

bestAttemptContent?.body = "We could not verify this notification with the server"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be translated.

Also move out of the if statement and assign to the declared notification variable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the translation, but couldn't make it work. Not sure if a problem of working locally (I ran the replace_assets lane and even though didn't seem to work), but since I am following the same pattern as in other places in the code, I don't think is a problem exactly on this app.

}
}
} else {
self.contentHandler?(notification)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will display the original msg in the notification for OS lower than 15, we ok with that? That if of course unless you address the previous comment

@larkox larkox marked this pull request as ready for review April 5, 2024 08:29
Copy link
Member

@jupenur jupenur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@larkox larkox requested a review from enahum April 12, 2024 16:19
@larkox larkox removed the 3: Security Review Review requested from Security Team label Apr 12, 2024
@larkox larkox requested a review from yasserfaraazkhan April 12, 2024 16:36
@larkox larkox requested a review from harshilsharma63 April 15, 2024 11:44
Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems ok, i would have loved not to hardcode the versions but I guess it is what it is

@@ -227,6 +238,153 @@ public static void createNotificationChannels(Context context) {
}
}

public static boolean verifySignature(final Context context, String signature, String serverUrl, String ackId) {
if (signature == null) {
Log.i("Mattermost Notifications Signature verification", "No signature in the notification");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for backward compatibility with older servers? If so, can we add a comment and ticket to make signature verification mandatory after, say, next two ESRs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for compatibility with old push proxies. I can add a comment about that.

break;
}

if (major < majorTarget) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should equal value case also be included here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only check the minor version if the version is exactly the same. So... imagine we have the targets 9.8.0 and 7.5.0.

If we are on version 8.0.0, when comparing with 9.8.0, since the major version is lower, we can continue to the next target. But if we are on version 9.9.0, even if the major version is the same, we want to check the minor version.

I hope it makes sense

@larkox larkox removed the 2: Dev Review Requires review by a core commiter label Apr 16, 2024
@larkox larkox added the 3: QA Review Requires review by a QA tester label Apr 16, 2024
Copy link
Contributor

@yasserfaraazkhan yasserfaraazkhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notifications did not show with New mobile app, New server, New proxy changes as expected.

Screenshot from 2024-04-12 18-21-16

@larkox larkox added 4: Reviews Complete All reviewers have approved the pull request and removed Do Not Merge Should not be merged until this label is removed 3: QA Review Requires review by a QA tester labels Apr 24, 2024
@larkox larkox merged commit c5e6e34 into mattermost:main Apr 24, 2024
7 checks passed
@amyblais amyblais added this to the v2.17.0 milestone Apr 24, 2024
cyrusjc pushed a commit to cyrusjc/mattermost-mobile that referenced this pull request May 18, 2024
* Fix MM 56723 (iOS)

* Add android

* Android fixes and version checking

* Add version check to ios

* Address feedback

* Add all versions to android

* Check all versions on iOS

* Fix unhandled version case

* Add comments

* Add final version numbers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants