You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wot: normalize p-tag pubkeys before they enter the graph and the cache #1340
A contact list's p tag value is not normalized before it enters the WoT graph or the Redis cache, so an uppercase hex pubkey can sit in distances and in wot:follows:<PUBKEY> alongside the lowercase form of the same key.
Why it matters
pubkeySchema requires lowercase hex (src/schemas/base-schema.ts:15), so an event author is always lowercase.
tagSchema accepts any string (src/schemas/base-schema.ts:30), so a p value passes unchanged.
extractFollowedPubkeys() (src/services/wot-graph-service.ts:24) returns it as-is, and followSetKey() (:14) embeds it as-is.
updateFollowList() only rebuilds when this.distances.has(pubkey) (:104 on main) — an owner whose only graph entry is uppercase misses that check, so a new contact list does not trigger the rebuild that the lowercase form would.
Read at main = 1b957d43, before the bounds patch: extractFollowedPubkeys, followSetKey and the distances.has(pubkey) gate all exist with the same shape. It surfaced as a CodeRabbit "Minor" on #1339, which does not touch those lines.
Suggested fix
Lowercase where the value enters the graph, not only at the cache keys — distances would still hold the uppercase form otherwise:
Activity