Repository navigation
Conversation
An identity link's pill showed the label written in the link, so any client could draw an ordinary @wes pill that opened someone else's profile, and edited namesakes looked identical. Name the pill from its key, as buzz-app does, and have message rows resolve linked keys for labels and agent icons. Group typed mention names by foldMentionLabel, as the text scan compares them, so names equal under folding fail as ambiguous instead of tagging one member. Signed-off-by: Tom Brow <tomb@block.xyz>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…previews A linked key with no profile, directory or roster name keeps the label written into its link instead of a compact npub. Inbox and search previews draw identity links by destination, reference-style definitions yield their keys, and forum cards collect keys only from the preview they show. Signed-off-by: Tom Brow <tomb@block.xyz>
An identity link whose key has no name here keeps its written label even when the key is also tagged. Rows request uncached profiles for linked keys so the key's name replaces the written label once it loads, the link scan is memoized per body, and the send-time key qualifier groups picked chips by folded name. Signed-off-by: Tom Brow <tomb@block.xyz>
A nameless tagged agent's mention name is its compact npub; an identity link to it keeps its written label, in pills and previews alike. Signed-off-by: Tom Brow <tomb@block.xyz>
Signed-off-by: Tom Brow <tomb@block.xyz>
Channel rows scan inline links outside code, accepting angle-bracketed and titled destinations and ignoring reference definitions. Inbox and search take keys from the preview pieces they render. A real name equal to a compact npub still names the link. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> Signed-off-by: Tom Brow <tomb@block.xyz>
Rows no longer scan message bodies for identity links. Under an IdentityLinkChannel, each drawn pill watches only its own key's real name and agent flag in the channel's names, and requests that key's profile when it is uncached. Links inside quoted fences, HTML comments or code never draw a pill, so they never load a profile. The preview key collector reads the same normalized source the preview renderer uses, so a label with brackets still loads its key. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> Signed-off-by: Tom Brow <tomb@block.xyz>
Signed-off-by: Tom Brow <tomb@block.xyz>
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
jedwards27
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent — integrated review
Verdict: COMMENT — recommend request changes. Reviewed f9b18c7f3a55b5ffcef33686cd766c34257c1956..1e4b3741e2819294a6a627eccd2a5af9cf436e6a (exact head). Risk: high — the display name of a linked identity must remain bound to its key, including after restart and reconnect. The diff is mobile-only; no relay wire contract changes. Both independent review lenses and the integration pass agree on the first blocker; the product/UI lens found the second.
-
[P2] Linked-key profile lookups skip stale restored profiles and fail to recover from a transient offline fetch.
mobile/lib/features/channels/message_mention_pill.dart:199-209andmobile/lib/features/channels/channel_identity_names_provider.dart:74-85gatepreloadon cache absence, butuser_cache_provider.dart:97-106,197-200restores names as present-but-unrevalidated and onlypreload/getschedules their refresh. An untagged link to a renamed non-member can keep showing its former name after a cold launch; channel-backed previews have the same skip. A failed first fetch is also one-shot while the pill remains mounted (user_cache_provider.dart:268-305), so reconnect need not replace the authored fallback label. Author action: request linked keys through the cache's coalescing/revalidation path even when restored, and arrange a bounded retry on reconnect for a still-mounted pill. Add production-seam regressions for restored old name → current name and offline → online on the same mounted link, including preview where applicable. -
[P2] Folded names remain ambiguous only in the ordinary send path, not edit hydration.
mobile/lib/features/channels/compose_bar/message_edit_sheet.dart:436-447indexes old tagged labels and looks upmentionOccurrencesresults withtoLowerCase(), while the scanner and this PR's composer path usefoldMentionLabel. Two tagged identities namedSamandſamcan seed one arbitrary bound edit chip depending on order; saving writes a link to that key. This edit path predates the diff, but it leaves the PR's stated unified typed-name ambiguity contract broken across the shared edit flow. Author action: fold both indexing and lookup in edit hydration and test both tag orders, asserting that an ambiguous historical label binds no arbitrary key.
Behavior/contracts traced: linked nostr:npub key controls navigation; ordinary unlinked text remains gated by signed p tags. Channel labels compare against the channel roster; profile cache resets with relay config. No independent new cross-key or cross-community binding defect found in these paths. Optional performance follow-up: messagePreviewIdentityKeys scans the full content with contains before extracting a bounded preview (preview_text.dart:154-165); profile before changing it.
Validation: On a clean Mac worktree at exact head, git rev-parse HEAD, git status --porcelain, git diff --check f9b18c7f3a55b5ffcef33686cd766c34257c1956...HEAD (pass). GitHub's head checks report Mobile Checks, Android, Mobile Tests 1/3–3/3 and Flutter flake check passing. Reviewer did not run the Flutter suite or an independent native/device journey; PR author describes an iOS simulator test-community journey, not reviewer proof. Added channel-row and preview parser tests do not cover restored snapshots, reconnect, or the edit ambiguity. Verification owner: author for fixes and regression tests; reviewer/tooling for an exact-head native/product journey and independent full mobile package gate after a new head. Residual risk: thread/forum/inbox/search journeys and stale-name recovery have not been independently witnessed. Green CI does not resolve the identified defects.
This is a comment review because repository policy reserves GitHub Request Changes for humans; the recommendation is request changes until both author actions are resolved.
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord recommends fixes at 1e4b374. The inline findings cover fenced-code previews, repeat profile requests, and per-link roster resolution. Source-only review. I also confirmed the linked-profile refresh and reconnect findings in Jude’s review.
| add(PreviewMedia(kind)); | ||
| continue; | ||
| } | ||
| final identity = _identityMention(label, url); |
There was a problem hiding this comment.
P2 — Keep fenced examples literal in previews. _keptLines recognizes unquoted backtick fences only. An identity link inside a tilde fence or a quoted fence becomes a mention pill in Inbox and Search and queues a profile lookup. Match the full message’s code handling before classifying preview links and collecting their keys.
There was a problem hiding this comment.
🤖 Fixed in e3b3d56: preview lines now recognize backtick and tilde fences, quoted or not, before classifying links or collecting their keys. Table rows cover both.
| if (missing.isNotEmpty) { | ||
| Future.microtask(() { | ||
| if (ref.context.mounted) { | ||
| ref.read(userCacheProvider.notifier).preload(missing); |
There was a problem hiding this comment.
P2 — Suppress repeat lookups after a successful empty response. When a linked key has no profile, a completed batch leaves it absent from userCacheProvider. Each later preview rebuild can enqueue another request, and scrolling a full-message pill out and back can do the same. Use a bounded, scope-specific cache for successful misses while preserving retries for failed requests and allowing newly published names to appear.
There was a problem hiding this comment.
🤖 Fixed in e3b3d56: the profile cache now remembers keys the relay answered with no profile, for this community scope only. Linked lookups skip those keys for 5 minutes, and the cache holds at most 1000 of them. A failed batch is not remembered, so it still retries on reconnect, and a newly published name shows up through live events or after the 5 minutes.
| : ref.watch( | ||
| channelIdentityNamesProvider(channelId).select( | ||
| (names) => ( | ||
| name: names.hasName(pubkey) ? names.labelFor(pubkey) : null, |
There was a problem hiding this comment.
P2 — Reuse roster lookup work across linked keys. IdentityNames.resolve builds and resolves the full roster plus the target for each distinct named nonmember. The channel scope is recreated on any profile cache update, so even an unrelated profile arrival can repeat that synchronous work for every such pill. Preserve the current naming policy while sharing roster comparison work and limiting recomputation to relevant changes.
There was a problem hiding this comment.
🤖 Fixed in e3b3d56: when a non-member's name can't match any member label (not a member's name, and not shaped like an owner, agent or key-suffix qualifier), it resolves without re-running the roster. Otherwise the full policy runs as before. A table test checks that both paths give the same label, for a person and for an agent.
Identity-link pills and preview rows now request their keys through the profile cache's revalidation path, so a restored former name is replaced, a failed lookup retries once the relay reconnects, and a key with no profile is not asked for again for five minutes. Previews keep tilde and quoted fences literal, edit hydration folds names as the mention scan does, and a non-member whose name cannot collide skips re-resolving the whole roster. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> Signed-off-by: Tom Brow <tomb@block.xyz>
Signed-off-by: Tom Brow <tomb@block.xyz>
|
🤖 Addressing Jude's review, in e3b3d56:
|
A link to a key another lookup already had on the way skipped the reconnect retry, so a failed batch could leave its pill on the old or written label. Enroll it once and let the batch loader dedupe. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> Signed-off-by: Tom Brow <tomb@block.xyz>
An unquoted fence now ends only at an unquoted closer, so a quoted fence line inside it stays code. A quoted fence ends when its quote does. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> Signed-off-by: Tom Brow <tomb@block.xyz>
jedwards27
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent — integrated review
Verdict: COMMENT — recommend request changes. Reviewed 8a3912f1511a46faf30b4cef774c634529e9f2f1..efbd18474e0308862b97a95d8fbe2d5757c7ed48 (exact head). Risk: high: identity-link labels and historical signed mentions must not misidentify a key after reconnect or under Unicode-folded ambiguity. Mobile/client presentation and interpretation of existing signed p tags changed; no relay wire contract changed. The prior 1e4b374 review is superseded. The restored-profile, settled-offline and edit-hydration paths have been fixed on the traced routes; two author-actionable defects remain:
-
[P2] Reconnect overtaking an in-flight linked-profile lookup still drops the retry.
mobile/lib/shared/profile/user_cache_provider.dart:179–185,314–379: the connected listener calls_scheduleFetchwhile the key is_inFlight, so the retry is skipped. If the old request rejects afterward,finallyclears_inFlightwithout scheduling_linkedUnanswered. A mounted pill can remain on its authored/stale label until another reconnect/remount. At this exact head, a temporary test using the production notifier held the first fetch, transitioned reconnecting→connected, then rejected it;flutter test --no-pub ... --plain-name 'review probe: reconnect before failed link flight settles'failed Expected: 2; Actual: 1. The probe was removed and the worktree restored clean. Real history can outlive the socket replacement or await the rate-limit gate (mobile/lib/shared/relay/relay_session.dart:327–353,604–671). The newneedsLinkedLookupbranch and passing test cover a link joining another pending preload but settle its first fetch before reconnect (user_cache_provider_test.dart:428–465); they do not cover this ordering. Author action: preserve a single reconnect retry intent until the old flight settles, then issue it; keep the reconnect-before-rejection production-seam regression. -
[P2] Fold-equivalent signed historical names still draw a falsely unique pill.
mobile/lib/shared/mentions/mention_bindings.dart:101–103,127–132folds occurrence matching but indexes signed names withtoLowerCase();mobile/lib/features/channels/message_content/mention_markdown.dart:44–47looks up the lowercased raw text. With two signed identities namedSamandſam, old unqualified@Samdraws a pill bound to Sam rather than ambiguous literal text. A temporary widget test through productionMessageContentwith both signed tags andonMentionTapfailed its “no MessageMentionPill” assertion: one pill rendered. Although this rendering path predates the diff, this PR claims consistent folded-name resolution for send/edit whiledocs/mention-editor.md:81–94forbids resolving ambiguous historical aliases by tag order. Author action: use the same fold for signed-text binding and its rendering consumers (includingMessagePreview), and test both signed-tag orders in a real channel/thread/preview path asserting no key-specific pill/tap.
Non-blocking performance mismatch: messagePreviewIdentityKeys includes the maxLines + 1 overflow line (mobile/lib/features/channels/message_content/preview_text.dart:154–164,181–184), while MessagePreview clips at maxLines (message_preview.dart:77–132). A link on line three of a two-line inbox/search preview can fetch an unseen key. This is bounded to an extra logical line and negative answers are cached; it contradicts the “only drawn links” claim but is not a separate merge blocker. Suggested follow-up: exclude overflow-only keys and test that immediate boundary.
Behavior/contracts traced: linked key determines navigation and label; signed p tags gate plain text; channel and no-channel previews request linked profiles. The new pending-preload join logic works, collision-shaped non-member names retain the full resolver, and quoted/unquoted preview fences have matching-closer tests. No separate cross-community binding defect found in those traced paths.
Validation: Mac clean exact-head worktree and git diff --check 8a3912f1511a46faf30b4cef774c634529e9f2f1...HEAD passed in both lanes. Product/UI lane: just mobile-check passed and flutter test mobile/test/features/channels/message_content/preview_text_test.dart passed (52); targeted channel-row, edit and composer tests passed at the preceding head. Systems lane: new pending-preload regression passed, reconnect-order probe failed as above. Temporary probes were removed; neither lane ran the full mobile package suite or independent native iOS/VoiceOver journey. At this new head, GitHub Mobile Checks and Mobile Tests 3/3 passed; Tests 1/3–2/3, Android, Flutter flake and native Swift were pending at the last read. Prior-head mobile gates passed but do not transfer to this SHA. Verification owner: author for the two fixes and behavioral regressions; reviewer/tooling for exact-new-head native, screen-reader and full mobile journey; CI/release gate for new-head checks. Residual risk: thread/forum/inbox/search and assistive journeys have not been independently witnessed on a device.
This is one COMMENT review because repository policy reserves GitHub Request Changes for humans; recommendation: request changes until the two author actions are resolved.
A blockquote continues over unmarked lines and ends only at a blank line, which also closes a fence opened inside it. The reconnect retry test now waits on the retried request instead of a fixed delay. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> Signed-off-by: Tom Brow <tomb@block.xyz>
… names A reconnect while a linked key is in flight now asks again once that flight settles, so a failed request no longer drops the retry. Signed historical names bind by the same fold the text scan uses, so names that fold alike stay ambiguous plain text in messages and previews. A preview no longer loads keys from the overflow line it never draws. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> Signed-off-by: Tom Brow <tomb@block.xyz>
|
🤖 Addressed in 92093ec:
Each regression fails on the previous head. The full mobile suite passes. |
|
🤖 Addressing Jude's review, all in 92093ec:
|
Follow-up to #9699 mention typing, fixing two identity problems found in its review.
Identity-link pills name the key they open. An edit writes each mention as an identity link,
[@Name](nostr:npub1…), and every message from any client draws such a link as a pill. Mobile showed the label written in the link, so[@Wes](nostr:<mallory>)drew an ordinary@Wespill that opened Mallory's profile, and two namesakes in an edited message both readScout. The pill now shows the name its key resolves to in the channel (with the namesake qualifier and agent icon), as buzz-app'sProfileMentionalready does. The written label shows only when the key has no name on this device (no profile, directory or roster name), never a compact npub in its place. This holds whether or not the link's key is also tagged. A pill requests its key's profile when uncached, so a written label gives way to the key's name once it loads.Edits carry no
ptag, so an identity-link pill resolves its own key. In channel, thread and forum rows the pill watches that one key's channel label (with the namesake qualifier and agent icon) and requests the key's profile when it builds, so only links that actually draw a pill cost a lookup, whatever Markdown surrounds them. Inbox and search previews draw identity links the same way, taking keys from the preview pieces they render. These keys never feed the text bindings, so plain@Nametext still binds only through signed tags.Typed names group the way the text scan reads them. The composer grouped the roster by
toLowerCasewhile the scan folds names withfoldMentionLabel. With membersSamandſam, typing@ſamsent Sam'sptag. Grouping, lookup and the send-time key qualifier now all fold, so namesakes under folding fail as ambiguous, as other namesakes already do.Linked lookups stay current and bounded. Pills and preview rows request their keys through the profile cache's revalidation path. A name restored from the last launch is revalidated, so a renamed key's link shows its current name. A lookup that fails while offline is retried once the relay reconnects, including when the reconnect comes while that lookup is still on the wire. A key the relay says has no profile is not asked for again for five minutes, and the cache remembers at most 1,000 such keys per community. Previews keep tilde and quoted code fences literal and read blockquotes as the full message does, and load only the links on lines they draw. Editing a message folds historical names the way the scan does, so a name two tagged people share under folding seeds no chip. Rendering binds signed names by the same fold, so with signed
Samandſama plain@Samstays text instead of drawing Sam's pill.Desktop (buzz-app) already names identity-link chips from the key and needs no change.
Validation
Rows add no per-message work: message bodies are no longer scanned for links. Each drawn identity-link pill adds one label watch for its own key.
Added tests:
[@Wes]to Mallory's key drawsMallory, and two editedScoutnamesakes draw distinct qualified labels, through the real channel row.Full-app run (iOS simulator, debug build, signed in to a test community): posted a message with a spoofed identity link, a link to a key with no profile here, and a link inside inline code. The spoofed link drew the key's real name as a pill and opened that person's profile; the unknown key kept its written label; the code span stayed raw. The same message drew matching pills in search results and in the thread view.
Channel row loads: a row requests profiles only for links it draws as pills, not ones in a quoted code fence or an HTML comment.
Folded chip qualifiers: picked
@Samand@ſamchips both carry their keys on send.Ambiguous typed names table:
Samandſamin either roster order now refuse@ſamas ambiguous.Restart and reconnect journey: a restored old name and an offline first lookup both resolve after the relay reconnects, on the same mounted pills, and a key with no profile is not requested again.
Preview fences: tilde and quoted fences keep links and Markdown literal and load no keys.
Overtaken lookup: a reconnect during a link's failing lookup asks once more after it settles.
Folded signed names: signed
Samandſamin either tag order leave@Samas text in the message and its preview.Folded edit chips:
Samandſamtagged in either order open as text, with no chip.Non-member labels: a non-member labels the same with or without the roster shortcut, including names shaped like qualifiers.
Regressions
ſ/s,µ/μ, finalς/σ) are now one name when matching typed text, so a typed one between two such members asks for a pick instead of silently choosing one. Picked chips are unaffected.