[ARVADOS] created: 1.1.4-630-g6c6617781

Git user git at public.curoverse.com
Thu Jul 19 14:13:53 EDT 2018


        at  6c66177816fe128595454e9890d2c82a984cbc90 (commit)


commit 6c66177816fe128595454e9890d2c82a984cbc90
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Thu Jul 19 15:10:44 2018 -0300

    13851: Reverted use of discoveryDoc() on findAPI()
    
    Also checking adding a '/' to baseURL on discoveryDoc when needed.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/app/assets/javascripts/models/session_db.js b/apps/workbench/app/assets/javascripts/models/session_db.js
index 7d1b3b159..5d42fdf07 100644
--- a/apps/workbench/app/assets/javascripts/models/session_db.js
+++ b/apps/workbench/app/assets/javascripts/models/session_db.js
@@ -68,7 +68,7 @@ window.SessionDB = function() {
                 url = 'https://' + url;
             }
             url = new URL(url);
-            return db.discoveryDoc({baseURL: url.origin}).map(function() {
+            return m.request(url.origin + '/discovery/v1/apis/arvados/v1/rest').then(function() {
                 return url.origin + '/';
             }).catch(function(err) {
                 // If url is a Workbench site (and isn't too old),
@@ -231,9 +231,13 @@ window.SessionDB = function() {
         // discovery doc from a session's API server.
         discoveryDoc: function(session) {
             var cache = db.discoveryCache[session.baseURL];
-            if (!cache) {
+            if (!cache && session) {
                 db.discoveryCache[session.baseURL] = cache = m.stream();
-                m.request(session.baseURL+'discovery/v1/apis/arvados/v1/rest')
+                var baseURL = session.baseURL;
+                if (baseURL[baseURL.length - 1] !== '/') {
+                    baseURL += '/';
+                }
+                m.request(baseURL+'discovery/v1/apis/arvados/v1/rest')
                     .then(function (dd) {
                         // Just in case we're talking with an old API server.
                         dd.remoteHosts = dd.remoteHosts || {};
@@ -293,6 +297,7 @@ window.SessionDB = function() {
         autoLoadRemoteHosts: function() {
             var sessions = db.loadAll();
             var doc = db.discoveryDoc(db.loadLocal());
+            if (doc === undefined) { return; }
             doc.map(function(d) {
                 Object.keys(d.remoteHosts).map(function(uuidPrefix) {
                     if (!(sessions[uuidPrefix])) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list