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
set {
content = input.link ? {article: { source: input.link, title: input.title || input.link }} : undefined
}
// ...something
set if (Array.isArray(images) && images.length > 0) {
// set content (and override link if it was set); assume single image here
content = {media: images[0]}
}
set if (Array.isArray(images) && images.length > 1) {
content = {
multiImage: {
images: images,
}
}
}
Expected Behavior
I expect the content variable to always contain a new object with the single property; either {article}, {media}, or {multiImage}.
Current Behavior
It seems the existing object in the content variable gets merged with the new object instead, so I end up with {article, media}, {media, multiImage} and similar.
Possible Solution
I suspect the culprit might be in the interpreter; updating the stack is done with mergeVariables function which merges objects recursively:
Provide a general summary of the issue in the Title above
I have a Comlink with roughly the following flow (based on linkedin's PublishPost use case):
Expected Behavior
I expect the
content
variable to always contain a new object with the single property; either{article}
,{media}
, or{multiImage}
.Current Behavior
It seems the existing object in the
content
variable gets merged with the new object instead, so I end up with{article, media}
,{media, multiImage}
and similar.Possible Solution
I suspect the culprit might be in the interpreter; updating the stack is done with
mergeVariables
function which merges objects recursively:one-sdk-js/src/core/interpreter/map-interpreter.ts
Line 389 in e689595
Your Environment
The text was updated successfully, but these errors were encountered: