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

Types for `User#callFunction` doesn't match implementation across platforms

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • Q4-22FY
    • Affects Version/s: None
    • Component/s: None

      Goals

      A strongly typed and unified API across Realm JS and Realm Web.

      Expected Results

      I would expect calling a MongoDB Realm function would have the same signature across our supported platforms.

      Actual Results

      The TypeScript declarations and Realm Web implementation takes arguments using "rest parameter" syntax. Whereas the Realm JS implemeation and JS docs takes an array of arguments as its 2nd positional argument.

      We might consider deprecating and consider the callFunction method private altogether, since we intent user to call functions in the slightly more convenient syntax:

      user.functions.sum(1, 2);
      

      Version of Realm and Tooling

      • Realm JS SDK Version: Realm JS 10.4.0 and Realm Web 1.2.1
      • Node, React Native and Web.
      • Client OS & Version: N/A
      • Which debugger for React Native: None

            Assignee:
            andrew.meyer@mongodb.com Andrew Meyer
            Reporter:
            kraen.hansen@mongodb.com Kræn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: