Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4380

Parameter type validation crashes Compass

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.23.0
    • Affects Version/s: 1.21.2, 1.22.0
    • Component/s: Compass
    • None
    • Iteration Maracuja
    • Not Needed

      When entering an invalid connection string the whole Compass crashes. This seems to happen if some of the url parameters have a wrong type (ie. I've added socketTimeoutMS twice and is considered to be an array instead of an integer)

      This is the error i get the console:

        electron-localshortcut eventStamp: [object Object] no match +0ms
      /usr/local/lib/node_modules/mongodb-connection-model/node_modules/ampersand-state/ampersand-state.js:214
                      throw new TypeError('Property \'' + attr + '\' must be of type ' + def.type + '. Tried to set ' + newVal);
                      ^
      TypeError: Property 'socketTimeoutMS' must be of type number. Tried to set 300,100
          at child.set (/usr/local/lib/node_modules/mongodb-connection-model/node_modules/ampersand-state/ampersand-state.js:214:23)
          at child.Base (/usr/local/lib/node_modules/mongodb-connection-model/node_modules/ampersand-state/ampersand-state.js:39:21)
          at child [as constructor] (/usr/local/lib/node_modules/mongodb-connection-model/node_modules/ampersand-state/ampersand-state.js:785:27)
          at new child (/usr/local/lib/node_modules/mongodb-connection-model/node_modules/ampersand-state/ampersand-state.js:785:27)
          at /usr/local/lib/node_modules/mongodb-connection-model/lib/model.js:1170:27
          at /usr/local/lib/node_modules/mongodb-connection-model/node_modules/mongodb/lib/core/uri_parser.js:116:9
          at parseConnectionString (/usr/local/lib/node_modules/mongodb-connection-model/node_modules/mongodb/lib/core/uri_parser.js:685:3)
          at QueryReqWrap.callback (/usr/local/lib/node_modules/mongodb-connection-model/node_modules/mongodb/lib/core/uri_parser.js:110:7)
          at QueryReqWrap.onresolve [as oncomplete] (dns.js:205:10)
      (edited)
      

            Assignee:
            maurizio.casimirri@mongodb.com Maurizio Casimirri
            Reporter:
            maurizio.casimirri@mongodb.com Maurizio Casimirri
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: