(localActivity, remoteActivity)
| 122 | } |
| 123 | |
| 124 | function reconcileActivity (localActivity, remoteActivity) { |
| 125 | const remote = activityFromRemote(remoteActivity) |
| 126 | if (!localActivity) { return remote } |
| 127 | if (!remote) { return localActivity } |
| 128 | if ((remote.count ?? 0) > (localActivity.count ?? 0)) { return remote } |
| 129 | if ((remote.count ?? 0) < (localActivity.count ?? 0)) { return localActivity } |
| 130 | if ((remote.last ?? 0) > (localActivity.last ?? 0)) { return remote } |
| 131 | return localActivity |
| 132 | } |
| 133 | |
| 134 | function writeActivityToCache (userId, activityName, activity) { |
| 135 | const key = getActivityStatusCacheKey(userId) |
nothing calls this directly
no test coverage detected