Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1893

Atlas Functions that return `undefined` return `null` when invoked by the JS SDK.

      How frequently does the bug occur?

      All the time

      Description

      when calling Realm.User.callFunction, if the Atlas Function in the cloud returns undefined, the JS client on device returns null.

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      n/a
      

      Can you reproduce the bug?

      Yes, always

      Reproduction Steps

      create and publish Atlas Function that returns undefined such as the following:

      // returnUndefined.js
      exports = () => {return;};
      

      then call function from the client:

        const res = await app.currentUser.callFunction("returnUndefined");
        console.log(res) // null
      

      Version

      10.19.3

      What SDK flavour are you using?

      Atlas App Services (auth, functions, etc.)

      Are you using encryption?

      No, not using encryption

      Platform OS and version(s)

      MacOS 11.6.3

      Build environment

      Node.js v16.13.2

      Cocoapods version

      No response

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: