profile
viewpoint

Pull request review commentfauna/faunadb-js

DRV-369: get rid of util nodejs package

 'use strict' +/**+ * Inherit the prototype methods from one constructor into another.+ * @param {function} ctor Constructor function which needs to inherit the prototype.+ * @param {function} superCtor Constructor function to inherit prototype from.+ * @private+ */+function inherits(ctor, superCtor) {

Added link to polyfill repo

tigger9flow

comment created time in 4 hours

Pull request review commentfauna/faunadb-js

DRV-369: get rid of util nodejs package

 'use strict' +/**+ * Inherit the prototype methods from one constructor into another.+ * @param {function} ctor Constructor function which needs to inherit the prototype.+ * @param {function} superCtor Constructor function to inherit prototype from.+ * @private+ */+function inherits(ctor, superCtor) {+  if (ctor === undefined || ctor === null) {+    throw new TypeError(+      'The constructor to "inherits" must not be ' + 'null or undefined'

Thanks for pointing, removed unnecessary concatenation

tigger9flow

comment created time in 4 hours

push eventfauna/faunadb-js

Artyom Kurnikov

commit sha 630317d5063007061d12428347a000cd781d4401

DRV-369: get rid of util nodejs package

view details

push time in 4 hours

Pull request review commentfauna/faunadb-js

DRV-369: get rid of util nodejs package

 'use strict' +/**+ * Inherit the prototype methods from one constructor into another.+ * @param {function} ctor Constructor function which needs to inherit the prototype.+ * @param {function} superCtor Constructor function to inherit prototype from.+ * @private+ */+function inherits(ctor, superCtor) {

Was this polyfill copied from somewhere? If so, could you add a link to it in the function docs?

tigger9flow

comment created time in 5 hours

Pull request review commentfauna/faunadb-js

DRV-369: get rid of util nodejs package

 'use strict' +/**+ * Inherit the prototype methods from one constructor into another.+ * @param {function} ctor Constructor function which needs to inherit the prototype.+ * @param {function} superCtor Constructor function to inherit prototype from.+ * @private+ */+function inherits(ctor, superCtor) {+  if (ctor === undefined || ctor === null) {+    throw new TypeError(+      'The constructor to "inherits" must not be ' + 'null or undefined'

(there's two more occurrences bellow)

tigger9flow

comment created time in 5 hours

Pull request review commentfauna/faunadb-js

DRV-369: get rid of util nodejs package

 'use strict' +/**+ * Inherit the prototype methods from one constructor into another.+ * @param {function} ctor Constructor function which needs to inherit the prototype.+ * @param {function} superCtor Constructor function to inherit prototype from.+ * @private+ */+function inherits(ctor, superCtor) {+  if (ctor === undefined || ctor === null) {+    throw new TypeError(+      'The constructor to "inherits" must not be ' + 'null or undefined'

What's the reason for the concatenation here?

tigger9flow

comment created time in 5 hours

Pull request review commentfauna/faunadb-js

Fix for stringification to FQL which inserted nulls for zero-argument AND expose toFQL

 var exprToString = function(expr, caller) {   var fn = keys[0]   fn = convertToCamelCase(fn) -  var args = keys.map(function(k) {+  var args = []++  keys.forEach(function(k) {

I would probably, do it as: keys .filter(function(k) { return expr[k] !== null }) .map(function(k) { return exprToString(v, fn) }) but it can be a matter of preference anyway.

fauna-brecht

comment created time in 7 hours

PR opened fauna/faunadb-js

Reviewers
DRV-369: get rid of util nodejs package

Notes

Jira Ticket NodeJS util package has been used for .inherits and .inspect functions. Current implementation supposes polyfilling .inherits function by created one in src/_util.js and optionally using .inspect only when we're running on NodeJS environment

How to test

No features / fixes have been introduced. Can be tested regression-wise

+44 -5

0 comment

4 changed files

pr created time in 12 hours

create barnchfauna/faunadb-js

branch : DRV-369/get-rid-of-util-package

created branch time in 12 hours

pull request commentfauna/faunadb-js

Fix FaunaDate test to ignore timezone

@erickpintor here is where FaunaTime transforms Date instance to iso string. so here is what i get

new Date(1970, 0, 1).toISOString()
"1969-12-31T21:00:00.000Z"
fireridlle

comment created time in 3 days

pull request commentfauna/faunadb-js

Fix FaunaDate test to ignore timezone

I'm surprised to see this test failing now since we've had folks in different timezones workin on the JS driver before. Do we know which part of the driver is rendering the wrong timezone? I don't oppose the fix. I'm just wondering what's the root cause.

fireridlle

comment created time in 3 days

PR opened fauna/faunadb-js

DRV-376 Fix request timeout

Notes

Jira Ticket Current driver pass a 60 seconds timeout down to the cross-fetch polyfill. However, neither whatwg-fetch of node-fetch are aware of it. They both support abort signals, though: https://github.com/node-fetch/node-fetch#request-cancellation-with-abortsignal.

Screenshots

image

+50 -12

0 comment

2 changed files

pr created time in 4 days

PR opened fauna/faunadb-js

Fix FaunaDate test to ignore timezone

Notes

Test "Values › date" doesn't respect timezone

Actual result

Values › date

    expect(received).toEqual(expected) // deep equality

    Expected: "{\"@date\":\"1970-01-01\"}"
    Received: "{\"@date\":\"1969-12-31\"}"

      86 |     var test_date = new FaunaDate(new Date(1970, 0, 1))
      87 |     var test_date_json = '{"@date":"1970-01-01"}'
    > 88 |     expect(json.toJSON(test_date)).toEqual(test_date_json)
         |                                    ^
      89 |     expect(json.parseJSON(test_date_json)).toEqual(test_date)
      90 |   })
      91 | 

      at Object.test (test/values.test.js:88:36)

Expected result

Test should be passed

How to test

jest --env=node --verbose=false ./test/values.test.js 
+1 -1

0 comment

1 changed file

pr created time in 4 days

issue commentfauna/faunadb-js

Unable to import into Cloudflare Workers

Sorry about that! I meant reverting back the faunadb package to 3.0.0.

step135

comment created time in 5 days

issue commentfauna/faunadb-js

Unable to import into Cloudflare Workers

In my case, after switching back to npm 3.0.0 the wrangler-cli can't even execute publish anymore. @jessepmason what OS are you on? Is it really npm v. 3 that works for you?

step135

comment created time in 5 days

delete branch fauna/faunadb-js

delete branch : fix-parser

delete time in 7 days

push eventfauna/faunadb-js

Erick Pintor

commit sha 06777483a2f0d4e8627b50fd01b54df4883c72aa

switch from contatenated to line-separated JSON

view details

Erick Pintor

commit sha 2e64c305d0a84eb10ee7b3e9e06ac857c97fc7a1

Merge pull request #373 from fauna/fix-parser ENG-2431: Switch from contatenated to line-separated JSON

view details

push time in 7 days

PR merged fauna/faunadb-js

Reviewers
ENG-2431: Switch from contatenated to line-separated JSON

Notes

To support for large JSON documents, we're moving from concatenated JSON objects to line-separated JSON streaming. This fix is intended to be backwards compatible while supporting the new line-separated format that is coming to cloud soon.

How to test

With a recent nightly build:

  • Create a document;
  • Open a stream for it;
  • Issue an updated with a relatively large JSON document (about 4KB or more).

Without this fix, the JSON parsing on the received version should break. With this path, you shall receive the updated version normally as part of the document stream.

We should release this fix once ENG-2431 is in cloud.

+85 -33

0 comment

4 changed files

erickpintor

pr closed time in 7 days

issue commentfauna/faunadb-js

Unable to import into Cloudflare Workers

Same here, reverting back to npm 3.0.0 seems to work.

step135

comment created time in 12 days

issue commentfauna/faunadb-js

Replace util with something smaller

That's good to hear. Thank you!

steida

comment created time in 13 days

issue commentfauna/faunadb-js

Replace util with something smaller

We’ve been short staffed, especially over the holidays, but we have more developers starting next week—specifically to help out with the drivers. This is at the top of the list.

steida

comment created time in 13 days

issue closedfauna/faunadb-js

Why so cool?

Why are @ryancharris and @rodrimaia so cool?

Can you pls solve.

closed time in 13 days

danieltodonnell

issue commentfauna/faunadb-js

Why so cool?

@ryancharris and @rodrimaia are being developed using a rolling release strategy. you can expect some cool features followed by some bugs aaaall the time

great UI, though. ;)

danieltodonnell

comment created time in 13 days

issue commentfauna/faunadb-js

Replace util with something smaller

Apologies for the delay in responding to this. Someone will take a look and respond soon.

Any updates on this? 😁

steida

comment created time in 13 days

issue commentfauna/faunadb-js

Why so cool?

Perhaps @ryancharris and @rodrimaia are actually UDFs? https://docs.fauna.com/fauna/current/tutorials/basics/functions.html#why

danieltodonnell

comment created time in 14 days

issue openedfauna/faunadb-js

Why so cool?

Why are @ryancharris and @rodrimaia so cool?

Can you pls solve.

created time in 14 days

issue closedfauna/faunadb-js

Child database for multi-tenancy app

I am trying to build a multi-tenancy app in FaunaDB. There is option of creating child databases from fauna shell. But my thinking is when a user is signed up, a child database with that username will create automatically. Is this possible to create a child database from JS directly?

closed time in 14 days

dhnchandan

issue commentfauna/faunadb-js

Getting socket hang up error occasionally

@marrony Yes, I can run the app locally. I'm not sure sure if the socket hang up error occurs when running the app locally. I haven't seen it yet, but I don't send high volumes of requests when testing locally.

When being kept up by PM2, I may get 10 socket hang up errors (or on fewer occasions, timeout errors) for every 5,000 calls to Fauna to make a write.

I've implemented a retry mechanism as a workaround to minimise data loss. However, I haven't been able to work out why this is happening in the first place and how to minimise it?

robertsamarji

comment created time in 18 days

issue commentfauna/faunadb-js

Getting socket hang up error occasionally

This is the first time I'm reading about PM2, if I understood correctly PM2 is a daemon for nodejs, so I don't see any reason for the driver to give that error. Can you run the script locally? Does this happen only in daemon mode?

robertsamarji

comment created time in 19 days

issue commentfauna/faunadb-js

Child database for multi-tenancy app

See https://docs.fauna.com/fauna/current/api/fql/functions/createdatabase?lang=javascript

dhnchandan

comment created time in 19 days

more