From 9942ad72d7330720c4ba7b54218d098a7cdbecb2 Mon Sep 17 00:00:00 2001 From: Przemyslaw Waliszewski Date: Tue, 25 May 2021 22:26:59 +0200 Subject: Fix empty Registered field on settings screen Registered field is stored in account object. Account object is stored in cache and it is set with first restApi invocation. During the login process, not all account fields are set but cache entry is set. This cache needs to be updated when settings screen is open. Bug: Issue 14600 Change-Id: I4cc1233868c9fafa1035983be14be1b304a348ee --- .../app/elements/settings/gr-account-info/gr-account-info.js | 2 ++ .../elements/shared/gr-rest-api-interface/gr-rest-api-interface.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js index 7e312d32e6..b1b5ba790e 100644 --- a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js +++ b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js @@ -102,6 +102,8 @@ class GrAccountInfo extends GestureEventListeners( this._serverConfig = config; })); + promises.push(this.$.restAPI.invalidateAccountsDetailCache()); + promises.push(this.$.restAPI.getAccount().then(account => { this._hasNameChange = false; this._hasUsernameChange = false; diff --git a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js index b675df71a0..72c805855c 100644 --- a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js +++ b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js @@ -1349,6 +1349,10 @@ class GrRestApiInterface extends mixinBehaviors( [ this._restApiHelper.invalidateFetchPromisesPrefix('/accounts/'); } + invalidateAccountsDetailCache() { + this._restApiHelper.invalidateFetchPromisesPrefix('/accounts/self/detail'); + } + /** * @param {string} filter * @param {number} groupsPerPage -- cgit v1.2.3