3meters / proxibase

Patchr web service
1 stars 0 forks source link

ActivityDate not updated when insert/delete a like link #426

Closed Jaymassena closed 8 years ago

Jaymassena commented 8 years ago

I'm not seeing the activityDate update when using the rest api to insert or delete a like link from a user to a message.

https://api.aircandi.com/v1/data/links

{"user":"us.000000.00000.000.000001","session":"206e35d846989f8589fc4df212b4290285318d70","data":{"type":"like","_from":"us.000000.00000.000.000001","_to":"me.160715.54016.750.492276"}}
Response Headers
georgesnelling commented 8 years ago

The relevant code is in link.js#updateActivityDates. Currently we only tickle the activity date of the linked-to entity for watch and content links. We don't tickle for likes. I believe you did not want to want to refetch and repaint just for a like, but it was a long time ago that we had that discussion.

Jaymassena commented 8 years ago

Probably an optimization that made sense at the time. I'd like it if we could change to treat all links the same until we have a compelling reason not to. It just keeps the client logic cleaner without unneeded special cases. You could make the case that when a link is updated/inserted/deleted, the activityDate should be tickled for both the from and to entities because link represent state that effects both.

I'd like to always count on that if activityDate or modifiedDate haven't changed, there is absolutely not reason to refetch an entity. Right now I have to execute a forced fetch on entities related to a like link to make sure the cache gets the latest.

georgesnelling commented 8 years ago

Ok, working on it now.

georgesnelling commented 8 years ago

Likes now tickle activity date.