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
I have this issue where some fields sent over from the Ruby side are missing on the JS side. After a lot of testing, it seems to be happening with mixed Ruby hashes (with both symbols and string keys) sent via call().
How to reproduce from the Ruby side:
hash1 = { # all symbols, will work fine
a: 1,
b: 'hello'
}
hash2 = { # all strings, will work fine
'a' => 1,
'b' => 'hello'
}
hash3 = { # mixed, b will be missing
'a' => 1,
b: 'hello'
}
call('test', hash1)
call('test', hash2)
call('test', hash3)
Interestingly, this does not happen when sending data via promise resolution:
on('test1') do |deferred|
deferred.resolve({ a: 1, b: 'hello' })
end
on('test2') do |deferred|
deferred.resolve({ 'a' => 1, 'b' => 'hello' })
end
# This time it works
on('test3') do |deferred|
deferred.resolve({ 'a' => 1, b: 'hello' })
end
So maybe there's a serialization inconsistency between call() and resolve()?
I tried poking a bit in the code but at first glance I cannot see what goes wrong.
The text was updated successfully, but these errors were encountered:
Hi :)
I might have found a serialization bug.
I have this issue where some fields sent over from the Ruby side are missing on the JS side. After a lot of testing, it seems to be happening with mixed Ruby hashes (with both symbols and string keys) sent via
call()
.How to reproduce from the Ruby side:
The output on the JS side:
Interestingly, this does not happen when sending data via promise resolution:
So maybe there's a serialization inconsistency between call() and resolve()?
I tried poking a bit in the code but at first glance I cannot see what goes wrong.
The text was updated successfully, but these errors were encountered: