From 7086749c261fd44b2ed7aedfe79a50a37df6d33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= Date: Thu, 24 Mar 2022 18:06:46 +0100 Subject: [PATCH] fix(frontend): found the root cause of the user search not returning values --- .../frontend/src/main/pages/stream/Collaborators.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/main/pages/stream/Collaborators.vue b/packages/frontend/src/main/pages/stream/Collaborators.vue index aebf94f5d..b0f53f259 100644 --- a/packages/frontend/src/main/pages/stream/Collaborators.vue +++ b/packages/frontend/src/main/pages/stream/Collaborators.vue @@ -255,6 +255,9 @@ export default { }, debounce: 300, // if the same query is input after adding a contributor, it doesn't show the proper results with caching + // the cause was the error on the filtered search results prop breaking + // but it still can be reasonable to disable this query caching for any user permission changes + // happening while the cache is still active fetchPolicy: 'no-cache' }, serverInfo: { @@ -343,7 +346,11 @@ export default { async addCollab(user) { this.loading = true this.search = null - this.userSearch.items = null + // the line below is meant to disable the apollo cache? if so, its not doing that + // rather it breaks the filteredSearchResults computed property + // which in turn fails silently, without any errors, just not having values + // TODO: check with Dim + // this.userSearch.items = null user.role = 'stream:contributor' await this.grantPermissionUser(user) this.stream.collaborators.unshift(user)