[ARVADOS] updated: 2.1.0-122-g0fe238d1f

Git user git at public.arvados.org
Mon Nov 23 15:59:30 UTC 2020


Summary of changes:
 apps/workbench/app/controllers/users_controller.rb | 11 +++++++++++
 lib/controller/federation/conn.go                  |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

       via  0fe238d1f4240d22b2c58838b03a7607656652d3 (commit)
      from  9d755d7dc0df6975e8b46cbaac6867abefdd138f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 0fe238d1f4240d22b2c58838b03a7607656652d3
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Nov 23 10:59:06 2020 -0500

    17154: Add comment.  Use strings.HasPrefix
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index d782bcb40..21ea7a8e6 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -39,6 +39,17 @@ class UsersController < ApplicationController
 
   def profile
     params[:offer_return_to] ||= params[:return_to]
+
+    # In a federation situation, when you get a user record using
+    # "current user of token" it can fetch a stale user record from
+    # the local cluster. So even if profile settings were just written
+    # to the user record on the login cluster (because the user just
+    # filled out the profile), those profile settings may not appear
+    # in the "current user" response because it is returning a cached
+    # record from the local cluster.
+    #
+    # In this case, explicitly fetching user record forces it to get a
+    # fresh record from the login cluster.
     Thread.current[:user] = User.find(current_user.uuid)
   end
 
diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index 0d155c673..130368124 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -466,7 +466,7 @@ func (conn *Conn) UserUpdate(ctx context.Context, options arvados.UpdateOptions)
 	if err != nil {
 		return resp, err
 	}
-	if options.UUID[:5] != conn.cluster.ClusterID {
+	if !strings.HasPrefix(options.UUID, conn.cluster.ClusterID) {
 		// Copy the updated user record to the local cluster
 		err = conn.batchUpdateUsers(ctx, arvados.ListOptions{}, []arvados.User{resp})
 		if err != nil {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list