dxos-deprecated / sdk

DXOS SDK and tools.
GNU Affero General Public License v3.0
0 stars 2 forks source link

BotDialog requires name (not wrn) field in the bot-factory record #420

Closed telackey closed 3 years ago

telackey commented 3 years ago

This code throws an error if there is no name field:

  useEffect(() => {
    if (Array.isArray(registryBotFactories)) {
      const botFactory = registryBotFactories.find(({ name }) => name === window.location.hostname) ||
        registryBotFactories.find(({ name }) => name.endsWith(BOT_FACTORY_DOMAIN));
      if (botFactory) {
        setBotFactoryTopic(botFactory.topic);
        setAdvanced(false);
      } else {
        setAdvanced(true);
      }
    }
  }, [registryBotFactories])

But most manually registered bot-factories do not have names (see https://apollo1.kube.moon.dxos.network/app/wrn:dxos:application:console/#/registry).

It makes more or less a matter of luck that most of our usage has happened to be on kubes with bot-factories where the window.location matched the name in the bot-factory registration.