canjs / can-connect-feathers

The FeathersJS client library for DoneJS and can-connect
https://canjs.com/doc/can-connect-feathers.html
MIT License
10 stars 4 forks source link

changes to work with can-connect 2 & can-observation 4 #94

Closed mickmcgrath13 closed 6 years ago

mickmcgrath13 commented 6 years ago

Not Fixed

Error

in session/session_tests-x-provider.js, the handler method never gets called. It is making the assumption that the Session.on('current', handler) will be called when a session is created, and that doesn't seem to be happening anymore.

Needs fix

Did the binding of a constructor event change?

Error

Files not found:

GET http://localhost:8080/node_modules/can-fixture/node_modules/can-connect/node_modules/steal-stache/package.json 404 (Not Found)
GET http://localhost:8080/node_modules/can-define/node_modules/can-compute/node_modules/can-stache-key/package.json 404 (Not Found)
GET http://localhost:8080/node_modules/can-define/node_modules/can-stache-key/node_modules/can-reflect-promise/package.json 404 (Not Found)

Needs fix

Why are these files not found? Are they causing problems?

Error

Unhandled promise rejection -> NotAuthenticated

{"name":"NotAuthenticated","message":"Could not find stored JWT and no authentication strategy was given","code":401,"className":"not-authenticated","errors":{}}

Is this an issue?

Fixed

Error

can-connect/can/map/map must be configured with a List type

Error: Error loading "can-connect-feathers@3.7.1#test/test" at http://localhost:8080/test/test.js
Error: can-connect/can/map/map must be configured with a List type
      at Behavior.init (http://localhost:8080/node_modules/can-connect/can/map/map.js:31:11)
      at Behavior.init (http://localhost:8080/node_modules/can-connect/can/ref/ref.js:432:24)
      at connect (http://localhost:8080/node_modules/can-connect/connect.js:50:12)
      at runSessionTests (http://localhost:8080/session/session_tests-x-provider.js:123:23)
      at Object.eval (http://localhost:8080/session/session_test.js:77:1)
      at eval (http://localhost:8080/session/session_test.js:153:4)
      at eval (http://localhost:8080/session/session_test.js:153:98)
  Evaluating http://localhost:8080/session/session_test.js
  Evaluating http://localhost:8080/test/test.js

Fixed by

Add list to the session defineMap

  Session.List = DefineList.extend({
    '*': Session
  });

Error

Cannot define property _saving, object is not extensible

browser.js:3 Unhandled promise rejection TypeError: Cannot define property _saving, object is not extensible
    at Function.defineProperty (<anonymous>)
    at Function.define.property (can-define.js:309)
    at Object.defineExpando (define-helpers.js:29)
    at User.setKeyValue (map.js:52)
    at Object.setKeyValue (get-set.js:50)
    at Behavior.save (map.js:311)
    at User.eval [as save] (map.js:689)
    at eval (session_tests-x-provider.js:199)
    at eval (browser.js:3)
    at eval (browser.js:3)

Fixed by

define _saving property on User defineMap

Error

Cannot define property _destroying, object is not extensible

TypeError: Cannot define property _destroying, object is not extensible
    at Function.defineProperty (<anonymous>)
    at Function.define.property (can-define.js:309)
    at Object.defineExpando (define-helpers.js:29)
    at User.setKeyValue (map.js:52)
    at Object.setKeyValue (get-set.js:50)
    at Behavior.destroy (map.js:322)
    at User.eval [as destroy] (map.js:745)
    at eval (session_tests-x-provider.js:213)
    at eval (browser.js:3)
    at eval (browser.js:3)

Fixed by

define destroying property on User defineMap

Error

A bunch of these failures:

TypeError: Cannot define property _instanceDefinitions, object is not extensible
    at Function.defineProperty (<anonymous>)
    at Object.defineExpando (define-helpers.js:20)
    at Account.setKeyValue (map.js:52)
    at Object.setKeyValue (get-set.js:50)
    at Behavior.save (map.js:311)
    at Account.eval [as save] (map.js:689)
    at eval (session_tests-x-provider.js:343)
    at eval (browser.js:3)
    at eval (browser.js:3)
    at MutationObserver.f (browser.js:2)

Fixed by

Adding _saving and _destroying to Message DefineMap in service/service_tests-x-provider.js

Error

A bunch of tests were failing due to a deepEqual of a pre-saved map and a map retrieved via .find. They were different because .save adds _saving and _destroying and one map had those props while the other didn't.

Fixed by

I worked around this issue for now calling .serialize() on both maps which (somehow) makes them both have _saving and _destroying. (?? not sure what's going on there).

mickmcgrath13 commented 6 years ago

Also, the whole _saving and _destroying stuff seems rather tedious to me.. should those values be added automatically like that? Wouldn't that mean that anyone who wants to use .save would need to define _saving and _destroying ?

mickmcgrath13 commented 6 years ago

all above issues fixed by updating more of the dependencies :)