MCPcopy Create free account
hub / github.com/codeaashu/claude-code / touch

Method touch

src/server/web/user-store.ts:24–41  ·  view source on GitHub ↗

* Called when a session is created for a user. * Creates the user record if it doesn't exist yet; increments sessionCount.

(userId: string, meta?: { email?: string; name?: string })

Source from the content-addressed store, hash-verified

22 * Creates the user record if it doesn't exist yet; increments sessionCount.
23 */
24 touch(userId: string, meta?: { email?: string; name?: string }): void {
25 const existing = this.users.get(userId);
26 if (existing) {
27 existing.lastSeenAt = Date.now();
28 existing.sessionCount += 1;
29 if (meta?.email && !existing.email) existing.email = meta.email;
30 if (meta?.name && !existing.name) existing.name = meta.name;
31 } else {
32 this.users.set(userId, {
33 id: userId,
34 email: meta?.email,
35 name: meta?.name,
36 firstSeenAt: Date.now(),
37 lastSeenAt: Date.now(),
38 sessionCount: 1,
39 });
40 }
41 }
42
43 /**
44 * Called when a session is destroyed for a user.

Callers 1

pty-server.tsFile · 0.80

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected