Bug #13851

Workbench multi-site search bug

Added by Peter Amstutz about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
07/19/2018
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release:
Release relationship:
Auto

Description

session_db.self-4814f5dc77cd9abd79a4cae265aa417dbb16c0dc7ab99fece07391fac5bcaf23.js?body=1:73 Uncaught TypeError: db.discoveryDoc(...).map(...).catch is not a function
    at window.SessionDB.findAPI (session_db.self-4814f5dc77cd9abd79a4cae265aa417dbb16c0dc7ab99fece07391fac5bcaf23.js?body=1:73)
    at HTMLFormElement.onsubmit (sessions.self-729bb276a57aec159a0bcdbb99ca42f47fc9bcf52a6e18a1c0b514727bcb4f5b.js?body=1:79)
    at HTMLFormElement.callback (npm-dependencies.self-ad43882e3d5843bd283629f28ba745a7d3bde41937fa6e389b3ecd717d93ef6d.js?body=1:11776)

This is because SessionDB.discoveryDoc is returning a mithril stream (m.stream()) but SessionDB.findAPI is expecting a Javascript Promise.

Also I ran into another problem in SessionDB.findAPI:

            return db.discoveryDoc({baseURL: url.origin}).map(function() {

This is a problem because url.origin does not end in "/", but SessionDB.discoveryDoc calls m.request(session.baseURL+'discovery/v1/apis/arvados/v1/rest')

(this results in "http://example.com:8000discovery/v1/apis/arvados/v1/rest")

-                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')

Subtasks

Task #13872: Review 13851-wb-multisite-searchClosedLucas Di Pentima


Related issues

Related to Arvados - Bug #13105: Missing federation config makes the multi-site search's session manager fail to log inResolved04/06/2018

Associated revisions

Revision bef56b9a
Added by Lucas Di Pentima about 3 years ago

Merge branch '13851-wb-multisite-search'
Closes #13851

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <>

History

#1 Updated by Peter Amstutz about 3 years ago

  • Related to Bug #13105: Missing federation config makes the multi-site search's session manager fail to log in added

#2 Updated by Peter Amstutz about 3 years ago

  • Description updated (diff)

#3 Updated by Lucas Di Pentima about 3 years ago

  • Assigned To set to Lucas Di Pentima

#4 Updated by Lucas Di Pentima about 3 years ago

  • Status changed from New to In Progress

#5 Updated by Lucas Di Pentima about 3 years ago

Updates at 6c6617781 - branch 13851-wb-multisite-search
Test run: (not being able to run on Jenkins)

Reverted the use of discoveryDoc() on findAPI() to check if the API server exist, because it returns a mithril stream and not a Promise as observed by Peter. This was mistakenly changed in the past to take advantage of the discoveryDoc() cache.

#6 Updated by Peter Amstutz about 3 years ago

Lucas Di Pentima wrote:

Updates at 6c6617781 - branch 13851-wb-multisite-search
Test run: (not being able to run on Jenkins)

Reverted the use of discoveryDoc() on findAPI() to check if the API server exist, because it returns a mithril stream and not a Promise as observed by Peter. This was mistakenly changed in the past to take advantage of the discoveryDoc() cache.

This LGTM, thanks!

#7 Updated by Lucas Di Pentima about 3 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

#8 Updated by Tom Morris about 3 years ago

  • Release set to 13

Also available in: Atom PDF