You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using AppServiceRegistration.fromObject({ ... }) followed by registration.outputAsYaml() results in yaml serializing error about pushEphemeral being undefined. See below for full cause.
But if you use AppServiceRegistration.fromObject({ ... }), it will look for obj["de.sorunome.msc2409.push_ephemeral"] in the object you pass in. For most people, the de.sorunome.msc2409.push_ephemeral key will be undefined.
Then when you try to save the registration to a YAML file via registrationConfig.outputAsYaml(), it will fail to serialize the undefined value.
Uncaught exceptionYAMLException: unacceptable kind of an object to dump [object Undefined]
at writeNode (C:\Users\MLM\Documents\GitHub\matrix-appservice-bridge\node_modules\js-yaml\lib\js-yaml\dumper.js:779:13)
at writeBlockMapping (C:\Users\MLM\Documents\GitHub\matrix-appservice-bridge\node_modules\js-yaml\lib\js-yaml\dumper.js:657:10)
at writeNode (C:\Users\MLM\Documents\GitHub\matrix-appservice-bridge\node_modules\js-yaml\lib\js-yaml\dumper.js:750:9)
at dump (C:\Users\MLM\Documents\GitHub\matrix-appservice-bridge\node_modules\js-yaml\lib\js-yaml\dumper.js:840:7)
at Object.safeDump (C:\Users\MLM\Documents\GitHub\matrix-appservice-bridge\node_modules\js-yaml\lib\js-yaml\dumper.js:846:10)
at AppServiceRegistration.outputAsYaml (C:\Users\MLM\Documents\GitHub\matrix-appservice-bridge\node_modules\matrix-appservice\lib\app-service-registration.js:186:64)
at Object.<anonymous> (C:\Users\MLM\Documents\GitLab\webapp\modules\matrix-bridge\lib\bridge.js:44:22)
MadLittleMods
changed the title
AppServiceRegistration.fromObject({ ... }) -> registration.outputAsYaml fails to serialize
AppServiceRegistration.fromObject({ ... }) -> registration.outputAsYaml fails to serialize undefined value
Oct 30, 2020
Using
AppServiceRegistration.fromObject({ ... })
followed byregistration.outputAsYaml()
results in yaml serializing error aboutpushEphemeral
beingundefined
. See below for full cause.Cause
Normally
pushEphemeral
is set tofalse
.But if you use
AppServiceRegistration.fromObject({ ... })
, it will look forobj["de.sorunome.msc2409.push_ephemeral"]
in the object you pass in. For most people, thede.sorunome.msc2409.push_ephemeral
key will beundefined
.Then when you try to save the registration to a YAML file via
registrationConfig.outputAsYaml()
, it will fail to serialize theundefined
value.Reproduction test case
Error:
Relevant code
src/app-service-registration.ts#L39
Found while working on https://gitlab.com/gitlab-org/gitter/webapp/-/merge_requests/2040
The text was updated successfully, but these errors were encountered: