Open MotaOcimar opened 1 year ago
Note: I'm using Dapr SDK 3.0.0 because newer versions give me the following error
internal/modules/cjs/loader.js:888
throw err;
^
Error: Cannot find module 'node:stream'
Require stack:
- D:\dapr-playground\node_modules\@dapr\dapr\utils\Streams.util.js
- D:\dapr-playground\node_modules\@dapr\dapr\implementation\Client\GRPCClient\crypto.js
- D:\dapr-playground\node_modules\@dapr\dapr\implementation\Client\DaprClient.js
- D:\dapr-playground\node_modules\@dapr\dapr\implementation\Server\DaprServer.js
- D:\dapr-playground\node_modules\@dapr\dapr\index.js
- D:\dapr-playground\publisher.js
Edit: Node Version: 14.17.0 Updating Node to v18.16.0 makes this error related to "node:stream" no longer happen. But the problem reported in this issue persists using Dapr SDK 3.2.0
This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.
Oh, I think this issue shouldn't be closed until it is solved
Expected Behavior
When calling the
client.pubsub.publish
function for a class, Dapr should send a CloudEvent with thedata
field filled with the value passed to the function. A type conversion could be done so that the value is sent correctly. For example, JavaScript'sObject.assign
could be used.If this option is not possible, the Dapr sdk function should return a response with the
error
field filled with a message describing the error.Actual Behavior
When calling the
client.pubsub.publish
function for a class, Dapr sends a CloudEvent with thedata
field empty. Thedata_base64
field is filled with the value[object Object]
, which does not describe the real object that should be sent.Steps to Reproduce the Problem
The received event will be something like: (Note there is no
data
field, butdata_base64
)Decoding the value of
data_base64
using base64, the value will be literally[object Object]
, which does not describe the real object that should have been sent.data
before sending the event and check the contents of the event received by Dapr:The received event will be something like: (Note that the
data
field is filled correctly)