Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

254
Vistas
Botframework (Node) - dialogData stripping out regex

Does the BotBuilder Node SDK actively strip out anything that is stored the dialogData object?

For example, I have created a simple loop and I am storing a regex in session.dialogData.questions. When I console log this after storing it, I can see that my regex is stored as expected:

  { 
    validation: /^[0-9]{19}$/,
  } 

However, when I try and log the same session.dialogData.questions object in the next step of my waterfall, then the regex seems to have been converted into an empty object:

  {
    validation: {}
  }

I presume this a deliberate attempt to prevent XSS and other types of exploitation?

The code for this example can be found below:

const builder = require('botbuilder')
const lib = new builder.Library('FormBuilder')

lib.dialog('/', [
    (session, args) => {
      session.dialogData.questions = {
        validation: /^[0-9]{19}$/
      }
      console.log(session.dialogData.questions)
      builder.Prompts.confirm(session, 'Would you like to proceed?')
    },
    (session, results) => {
      console.log(session.dialogData.questions)
    }
])

module.exports.createLibrary = () => {
  return lib.clone()
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Regarding your initial question, no the SDK doesn't actively strip anything out of the dialogData object. Anything that is, except for regexp...

I'm not sure why this is, but for the time being I recommend storing your pattern as a string, '^[0-9]{19}$', and then constructing a new regexp via new RegExp(session.dialogData.questions.validation) when needed.

I tried storing a method to construct a new RegExp using this.questions.validation, but likewise this was also stripped out.


Edit:

Per Ezequiel's comment, this isn't a Bot Framework issue in the end. It is not possible to store non-serializable data inside JSON.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda