can-connect icon indicating copy to clipboard operation
can-connect copied to clipboard

real-time behavior doesn't work unless callbacks behavior is included.

Open bmomberger-bitovi opened this issue 8 years ago • 3 comments

Creating an item when using real-time behavior is included in a connection fails to run the create() function therein, unless callbacks is also one of the connection behaviors.

Reason: real-time events are dependent on the {create/update/destroy}Data functions referenced by callbacks. Without callbacks, createData et al. in constructor call createdInstance, but ignore the createdData et al. in real-time.

The parts don't seem to line up. It seems that one of these three things should be true:

  • that real-time implements {created|updated|destroyed}Instance
  • that real-time imports callbacks and adds it to the connection chain
  • that real-time is documented to state that the behaviors do not work automatically on save/destroy without callbacks

None of these appear to be the case.

How often can you reproduce it?

  • [x] Always
  • [ ] Sometimes
  • [ ] Rarely
  • [ ] Unable
  • [ ] I didn’t try
Software Version
can-connect version 1.3.8
Browser Chrome 57
Operating system MacOS Sierra 12.3

bmomberger-bitovi avatar Mar 25 '17 02:03 bmomberger-bitovi

The last one is true. However, we really need can-interface.

Sent from my iPhone

On Mar 25, 2017, at 2:05 AM, Brad Momberger [email protected] wrote:

Creating an item when using real-time behavior is included in a connection fails to run the create() function therein, unless callbacks is also one of the connection behaviors.

Reason: real-time events are dependent on the {create/update/destroy}Data functions referenced by callbacks. Without callbacks, createData et al. in constructor call createdInstance, but ignore the createdData et al. in real-time.

The parts don't seem to line up. It seems that one of these three things should be true:

that real-time implements {created|updated|destroyed}Instance that real-time imports callbacks and adds it to the connection chain that real-time is documented to state that the behaviors do not work automatically on save/destroy without callbacks None of these appear to be the case.

How often can you reproduce it?

Always Sometimes Rarely Unable I didn’t try Software Version can-connect version 1.3.8 Browser Chrome 57 Operating system MacOS Sierra 12.3 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

justinbmeyer avatar Mar 25 '17 05:03 justinbmeyer

I wonder if @nlundquist 's work fixed this ...

justinbmeyer avatar Jun 02 '18 02:06 justinbmeyer

My recollection is we going to pursue a decorators based approach of easily adding behaviors and groups of behaviors. This was to try and make behavior configuration as easy as possible and punt on implementing behavior dependency resolution as we'd originally hoped, since it appeared we'd need to redesign the behaviors to give more detailed information about their dependencies to enable that.

I'll open a PR to add this dependency to the docs. Still interested on working on an annotation driven can-connect config if it's still makes sense given the grander can-data ambitions.

nlundquist avatar Jun 08 '18 03:06 nlundquist