oliver-zehentleitner / maity

web: fixture hub: cross chat helpers reuse profileOf and the code-point mention scanner (offsets differ for non-ASCII bodies)

Sign in to report

tsk-y51d8fdvrhs7 Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. View: fixture hub (api.js). Kind: duplication with a behaviour difference.

What is wrong

  • crossProfile (web/js/api.js:2288-2290) is the same as profileOf (:1386).
  • crossMentions (:2396-2409) is a second mention parser that counts offsets in UTF-16 units (found.index + lastIndexOf("@")); the project message route's parser (:5469-5484) counts code points (Array.from), as the hub does. A non-ASCII body gives different mention offsets in the two fixture routes.

Proposal

  • Use profileOf; share one code-point scanner for both routes.

Effort / risk: S. Low; fixture only.