canjs / can-connect

Model layer utilities for every JavaScript framework! Assemble real-time, high performance, restful data connections.
https://canjs.com/doc/can-connect.html
MIT License
29 stars 16 forks source link

fall-through-cache is opaque about when the data is finished updating. #450

Open bmomberger-bitovi opened 5 years ago

bmomberger-bitovi commented 5 years ago

Description: Using the fall-through-cache behavior in can-connect, MyModel.getList() returns a Promise that resolves to the value from the cache connection (if it exists). Then later, any new items are added. However, there is no indicator that the process has finished. The promise for the server call is swallowed by the fall-through-cache behavior and there is no event fired on the list to indicate it has been updated (or even kept the same).

Here's an example use case where this is not optimal.

Fall-through-cache connections should do one of the following for getList():

Environment:

Software Version
can-connect version 2.1.0
Browser All (tested on Chrome 71)
Operating system All (tested on MacOS 10.14.2)
justinbmeyer commented 5 years ago

I think there might be a pr about this by josh dean. There’s bound to be an issue too.

justinbmeyer commented 5 years ago

https://github.com/canjs/can-connect/pull/154

bmomberger-bitovi commented 5 years ago

154 is so out of date that it's not using reflected observability or expando properties. It would require an overhaul to be useful across the board.