MCPcopy Create free account
hub / github.com/codecombat/codecombat / peekActivityStatus

Method peekActivityStatus

app/models/User.js:661–669  ·  view source on GitHub ↗

* Pure read — local cache first, then me.activity. Never writes. * @returns {{ first: number, last?: number, count?: number } | null}

(activityName)

Source from the content-addressed store, hash-verified

659 * @returns {{ first: number, last?: number, count?: number } | null}
660 */
661 peekActivityStatus (activityName) {
662 const userId = this.get('_id') || this.id
663 if (!userId) { return null }
664
665 return userUtils.reconcileActivity(
666 userUtils.readActivityFromCache(userId, activityName),
667 this.get('activity')?.[activityName],
668 )
669 }
670
671 /**
672 * Read activity — hydrates local cache from me.activity when missing or stale.

Callers

nothing calls this directly

Calls 1

getMethod · 0.95

Tested by

no test coverage detected