Project

General

Profile

Actions

Bug #13851

closed

Workbench multi-site search bug

Added by Peter Amstutz over 6 years ago. Updated over 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 1 (0 open1 closed)

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 #1

Updated by Peter Amstutz over 6 years ago

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

Updated by Peter Amstutz over 6 years ago

  • Description updated (diff)
Actions #3

Updated by Lucas Di Pentima over 6 years ago

  • Assigned To set to Lucas Di Pentima
Actions #4

Updated by Lucas Di Pentima over 6 years ago

  • Status changed from New to In Progress
Actions #5

Updated by Lucas Di Pentima over 6 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.

Actions #6

Updated by Peter Amstutz over 6 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!

Actions #7

Updated by Lucas Di Pentima over 6 years ago

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

Updated by Tom Morris over 6 years ago

  • Release set to 13
Actions

Also available in: Atom PDF