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

[MM-54591] Use getVersion endpoint to report app name #2862

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

devinbinnie
Copy link
Member

Summary

For some reason app wasn't initialized in the preload script at the right time, causing issues that were breaking the downloads dropdown. This PR pushes us back to using the old endpoint of getAppVersion that provides both the version and app name when the dropdown initializes.

Ticket Link

https://mattermost.atlassian.net/browse/MM-54591

Fixed an issue where the downloads dropdown would not open on auto update notification.

@devinbinnie devinbinnie added 2: Dev Review Requires review by a core committer CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Sep 29, 2023
@devinbinnie devinbinnie added this to the v5.5.0 milestone Sep 29, 2023
Copy link
Member

@marianunez marianunez left a comment

Choose a reason for hiding this comment

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

@devinbinnie just to understand, is this a regression from a change in 5.5? If so, can you point me to the PR so I can reference for this review?

@devinbinnie
Copy link
Member Author

@devinbinnie just to understand, is this a regression from a change in 5.5? If so, can you point me to the PR so I can reference for this review?

Yep, was caused here: #2807 and partially fixed here: #2813

Copy link
Member

@marianunez marianunez left a comment

Choose a reason for hiding this comment

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

Thanks @devinbinnie! Any tests we can consider in the future for this area?

Comment on lines +19 to +32
return (
<UpdateAvailable
item={item}
appName={appName}
/>
);
}
if (item.state === 'completed') {
return <UpdateDownloaded item={item}/>;
return (
<UpdateDownloaded
item={item}
appName={appName}
/>
);
Copy link
Member

Choose a reason for hiding this comment

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

Not introduced in this PR but wondering why are these two cases separate? Seems they return the same thing

Copy link
Member Author

Choose a reason for hiding this comment

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

One is UpdateAvailable the other is UpdateDownloaded, there are separate components.

@devinbinnie
Copy link
Member Author

Thanks @devinbinnie! Any tests we can consider in the future for this area?

We don't currently have front-end testing set up for Desktop App, since it wasn't creating a lot of value.
E2E would be nice but we don't have a way to simulate auto-updates in the testing environment yet :(

@@ -40,6 +41,9 @@ class DownloadsDropdown extends React.PureComponent<Record<string, never>, State
window.desktop.downloadsDropdown.focus();
});

window.desktop.getVersion().then(({name}) => {
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit surprised to see that this works when you're removing this field in the type definition below. I guess it gets its type from somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does! It's here:

getVersion: () => Promise<{name: string; version: string}>;

@devinbinnie devinbinnie added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Sep 29, 2023
@devinbinnie devinbinnie merged commit 8281bbb into mattermost:master Sep 29, 2023
14 checks passed
@mattermost-build
Copy link
Contributor

Cherry pick is scheduled.

mattermost-build pushed a commit to mattermost-build/desktop that referenced this pull request Sep 29, 2023
@mattermost-build mattermost-build added CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone and removed CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Sep 29, 2023
devinbinnie added a commit that referenced this pull request Sep 29, 2023
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 CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants