Project

General

Profile

Actions

Bug #13851

closed

Workbench multi-site search bug

Added by Peter Amstutz almost 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
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 1 (0 open1 closed)

Task #13872: Review 13851-wb-multisite-searchClosedLucas Di Pentima07/19/2018Actions

Related issues

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

Also available in: Atom PDF