Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

PLT-8352 Handle getting user updated event for logged in user #527

Merged
merged 1 commit into from
Jan 2, 2018

Conversation

jwilander
Copy link
Member

Summary

Handle getting user updated event for logged in user by requesting self if update_at is newer than the one we have.

Ticket Link

Web app portion of https://mattermost.atlassian.net/browse/PLT-8352

Checklist

@jwilander jwilander added the 2: Dev Review Requires review by a core commiter label Jan 2, 2018
@jwilander jwilander added this to the v4.6.0 milestone Jan 2, 2018
if (user.update_at > currentUser.update_at) {
// Need to request me to make sure we don't override with sanitized fields from the
// websocket event
getMe()(dispatch, getState);
Copy link
Member Author

@jwilander jwilander Jan 2, 2018

Choose a reason for hiding this comment

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

The user sent by the WS event will have sanitized fields, but it's difficult to tell what is sanitized and what is actually blank. Easiest solution I could think of was to just request yourself again if the update_at for the WS provided user is newer. This will prevent the client making the update request from making this request but other tabs/clients will make it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems reasonable.

@crspeller crspeller merged commit 16522d0 into master Jan 2, 2018
@crspeller crspeller deleted the plt-8352 branch January 2, 2018 20:42
@lindalumitchell lindalumitchell added the Tests/Done Release tests have been written label Jan 3, 2018
@jasonblais jasonblais added Changelog/Done Required changelog entry has been written Docs/Not Needed Does not require documentation labels Jan 3, 2018
hmhealey pushed a commit that referenced this pull request Aug 28, 2020
* MM-10776: Adds support for new API endpoint to update team or channel member scheme roles. (#521)

* Disable fetch calls when offline (#522)

* Disable fetch calls when offline

* Move online check to doFetchWithResponse

* fix permission error on channel_converted event (in used by mobile RN) (#523)

* warn about dropping backwards compatibility just once (#525)

* Safely trying to instantiate Set. (#527)

* Safely trying to instantiate Set.

* Added warning

* Removes console.warn.
hmhealey pushed a commit that referenced this pull request Mar 17, 2021
* Safely trying to instantiate Set.

* Added warning
hmhealey pushed a commit that referenced this pull request Mar 17, 2021
* MM-10776: Adds support for new API endpoint to update team or channel member scheme roles. (#521)

* Disable fetch calls when offline (#522)

* Disable fetch calls when offline

* Move online check to doFetchWithResponse

* fix permission error on channel_converted event (in used by mobile RN) (#523)

* warn about dropping backwards compatibility just once (#525)

* Safely trying to instantiate Set. (#527)

* Safely trying to instantiate Set.

* Added warning

* Removes console.warn.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2: Dev Review Requires review by a core commiter Changelog/Done Required changelog entry has been written Docs/Not Needed Does not require documentation Tests/Done Release tests have been written
Projects
None yet
5 participants