@knowlearning/agents 0.9.152 → 0.9.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,11 @@ import { applyPatch } from 'fast-json-patch'
3
3
  import { getToken, login, logout } from './auth.js'
4
4
  import GenericAgent from '../generic/index.js'
5
5
 
6
+ const TEST_DOMAIN = 'tests.knowlearning.systems'
6
7
  const SECURE = window.location.protocol === 'https:'
7
8
  const DEVELOPMENT_HOST = `localhost:3200${ SECURE ? '1' : '2' }`
8
- const REMOTE_HOST = localStorage.getItem('mode') === 'staging' ? 'api.staging.knowlearning.systems' : 'api.knowlearning.systems'
9
+ const ENVIRONMENT_API_HOST = localStorage.getItem('API_HOST')
10
+ const REMOTE_HOST = window.location.hostname === TEST_DOMAIN && ENVIRONMENT_API_HOST ? ENVIRONMENT_API_HOST : 'api.knowlearning.systems'
9
11
 
10
12
  function isLocal() { return localStorage.getItem('api') === 'local' }
11
13
 
@@ -183,7 +183,7 @@ export default function messageQueue({ token, sid, domain, Connection, watchers,
183
183
  states[qualifiedScope] = await states[qualifiedScope]
184
184
 
185
185
  if (states[qualifiedScope].ii + 1 !== message.ii) {
186
- console.warn('OUT OF ORDER WATCHER RECEIVED', qualifiedScope, states[qualifiedScope], message)
186
+ //console.warn('OUT OF ORDER WATCHER RECEIVED', qualifiedScope, states[qualifiedScope], message)
187
187
  return
188
188
  }
189
189
 
package/agents/watch.js CHANGED
@@ -79,7 +79,7 @@ export default function({ metadata, environment, state, watchers, synced, sentUp
79
79
  }
80
80
  const watcherIndex = watchers[key].findIndex(x => x === fn)
81
81
  if (watcherIndex > -1) watchers[key].splice(watcherIndex, 1)
82
- else console.warn('TRIED TO REMOVE WATCHER THAT DOES NOT EXIST', key, fn)
82
+ //else console.warn('TRIED TO REMOVE WATCHER THAT DOES NOT EXIST', key, fn)
83
83
  }
84
84
 
85
85
  return [ watch, removeWatcher ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.152",
3
+ "version": "0.9.154",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",