Repository navigation
feat(import): consented conversation import service, consent card and imported-message rendering - #2229
Draft
jaykurian wants to merge 6 commits into
Draft
feat(import): consented conversation import service, consent card and imported-message rendering#2229jaykurian wants to merge 6 commits into
jaykurian wants to merge 6 commits into
Conversation
Kinds 42110 to 42113 and the relay-signed 30623 snapshot: record templates in NIP-CI key and tag order, strict parsers, validation of prepared imported events, a filter that drops imported history from live batches, and the plugin-facing service types. Signed-off-by: jaykurian <49807026+jaykurian@users.noreply.github.com>
The outbox gains sendAt for imported history at its original time with a deterministic id, and sendRecord for import records carrying exactly the NIP-CI tags. Both go through a module-private send path; the public send and retry refuse import entries, so listeners cannot forge them. A session's import writer serves only the first service that claims it. Failed import entries do not count toward the pending limit. Relay refusal text is kept on the journal entry. The native signer checks the record shape of kinds 42110 to 42113 as the browser broker does, and hosts report NIP-CI support from the relay's NIP-11 document. Signed-off-by: jaykurian <49807026+jaykurian@users.noreply.github.com>
Imported messages and reactions never count as unread evidence, inbox mentions, channel activity or agent triggers. Signed-off-by: jaykurian <49807026+jaykurian@users.noreply.github.com>
Consent, withdrawal and completion records render as system lines. Imported messages show their source and original time, an edited marker when the source recorded an edit, a compact marker on continuation rows, no manual Retry, and never trigger the new-message divider. Signed-off-by: jaykurian <49807026+jaykurian@users.noreply.github.com>
The conversationImport service checks verified identities and membership, shows host-owned confirmation dialogs for proposals, consents and new destinations, and publishes imported history paced at 8 events per second, waiting for other participants' parents and stopping on the first refusal or membership change. Host state is unreachable from plugins, and only the host can construct the service; dialogs approve only on a trusted click. Proposals and consents need relay NIP-CI support; publishing needs an active relay snapshot, and the destination is rechecked after each dialog and before each event. Attachment tags are derived from the file hash and the type the relay sniffs from the file's first bytes, so every participant produces the same event ids. The proposal renders as a consent card that reads its own snapshot, with a progress banner while active. Types are exported through the author package; gallery specimens added. Signed-off-by: jaykurian <49807026+jaykurian@users.noreply.github.com>
The relay refuses imported events for a short time after a session turns active and states when it will accept them in the snapshot's accepts_after tag. The snapshot read model carries it as acceptsAfter on this device's clock, moved earlier when the snapshot shows the relay's clock running ahead. publish waits until then before signing the first event, reporting progress phase "starting", and a cancel during the wait stops the run. A "session warming" refusal backs off to acceptsAfter, or 5 seconds without one, and publishes the same event again. The consent card counts down to the start while the import is active. Signed-off-by: jaykurian <49807026+jaykurian@users.noreply.github.com>
This was referenced Nov 4, 2026
matt2e
added a commit
that referenced
this pull request
Nov 9, 2026
## What the user saw When the relay refused a plain-text send, the message row stayed silent for about ten seconds and only then showed a small Retry. The relay actually answers in about 50 ms, so the user had no idea the message had failed until the ten-second delivery grace ran out. ## The fix `deliveryFeedback` applied the 10 s delivery grace (measured from `created_at`) to every non-`seen` state, `failed` included. The grace exists to hide uncertainty, and a `failed` send is not uncertain: every path to `failed` (relay refusal, rate-limited `PublishNotSent`, HTTP refusal, pre-publish error) proves the message was not delivered, while a transport error mid-publish becomes `unknown`. The grace check now applies only when `delivery !== "failed"`. `sending`, `accepted` and `unknown` still wait ten seconds from the message timestamp. A failed send restored after a reload shows Retry at once. `DeliveryNotice` needs no change: a new row re-renders it, and its grace timer is harmless for failed rows. The guard is keyed on the delivery state rather than the outbox item's `refused` flag, which never reaches `ChannelMessage`, is dropped on reload, and is not set for rate-limit refusals. ## Before and after "Lunch at 12?" is sent in #Alpha in both panels at the same moment and the relay refuses it as rate-limited. The overlay clock counts from pressing Enter. | | Relay refused | Retry visible | |---|---|---| | Before (main `58116b8`) | 0.06 s | 9.23 s | | After (fix) | 0.06 s | 0.06 s | https://github.com/user-attachments/assets/9253a010-28de-4670-80b6-9e28841145a0   ## Docs - `docs/shell-design.md`: the delivery rule now says failed sends show Retry immediately and only unconfirmed sends wait about ten seconds. - `docs/buzz-help.md`: same rule in the bundled help. ## Verification - `src/features/messages/delivery.test.ts`: narrows the ten-second quiet case to unconfirmed states and adds a failed-inside-the-grace case. - `src/features/messages/DeliveryNotice.test.tsx`: rerenders a row inside the grace as `sending`, `failed`, then `unknown` and expects no status, Retry, then no status. - Both new tests failed before the fix and pass after it. - `tsc --noEmit` and Biome are clean. ## Scope This is PR 1 of three independent changes from the refused-send note (the other two are the sidebar unsent marker and keeping failed sends out of previews). #2229 touches `DeliveryNotice.tsx` only in `canRetry` (an imported-row guard) and leaves the grace alone, so there is no conflict. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: mtoohey <mtoohey@squareup.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Imports a conversation from another workspace into Buzz only after every participant consents. Imported messages and reactions keep their original time and source, and never count as unread, inbox mentions, channel activity or agent triggers.
Relay side: block/buzz#8981. Reference plugin (Import from Slack) in squareup/agents: https://github.com/squareup/agents/pull/8946.
What it does
conversationImporthost service, which plugins reach through the context, proposes an import, collects consent through host-owned dialogs, and publishes imported history paced at 8 events per second. It waits for other participants' parents and stops on the first refusal or membership change.nip-ciin NIP-11supported_extensions.active.attachmentTags({ sha256Hex, name, size, head })deterministically derives an attachment's url, imeta tags and markdown from the file hash and its first 4096 bytes, sniffed the same way the relay does (relay-media-type.tsmirrors the relay'sinferandcfbrouting; unknown content becomes.bin, audio is refused). Every participant therefore produces identical event ids.uploadAttachmentthrows when the server's url or hash differs from the prediction.Evidence
bin/pnpm checkpasses. An independent review (Opus, three rounds) probed the host for plugin-reachable state, constructor escapes, forged claimants and spoofed clicks; every path is refused except the trust-model limit below. A 1,780-file differential run ofrelay-media-type.tsagainst the relay'sinfercrate found zero divergences.Risk and trust model
isTrustedclick check guard against buggy or accidental plugin code, not hostile code. Hostile same-origin script can still reach the dialog's approve closure through React's DOM internals, and for import-tagged kind 9 and kind 7 the signer cannot tell a host request from a plugin request. Closing that boundary needs a native confirmation in the Tauri signer, which is out of scope here. The limit is stated in the NIP-CI Security section.accepts_aftertime and retriesimport session warmingrefusals on the same event, so the relay's replica warm-up never skips a message.Host observations from a live plugin test
Eight plugins from squareup/agents#8946 (the import plugin among them) were installed from local folders into a signed-in Buzz Desktop 0.7.7 and exercised against real connectors. Nothing below blocks this PR, but each is host behaviour the plugins cannot work around:
host.processesentries shows one identical row per process ("Start sq: Can start a background process with additional arguments, using your account's full access"); only expanding a row reveals the arguments. The import plugin declares seven, so the review reads as seven copies of the same line.HostProcesshas no title or description field (deny_unknown_fields), so the manifest cannot label them.redirect::Policy::nonesurfaces to the plugin. Plugins now set their own User-Agent and followLocationwithin the declared origin, which every network plugin will have to repeat.agent-directoryas the source for every locally known name, the signed-in owner included. A plugin that read it as "this is an agent" mislabelled the viewer; the positive evidence lives inknownAgentPubkeys. Worth a doc note onNameSource.Foundation files touched
src/app/App.tsx: mountsConversationImportReview(4 lines).src/app/services.ts: creates the review queue andConversationImportHost, disposes the queue, and returns both to the host app (11 lines).src/plugins/author.ts: exports the plugin-facing import types, includingAttachmentTagsInput.src/features/relay/session.ts: registers the host-only import writer (sendAt,sendRecord,retry,dismiss,local), exposes theconversationImportNIP-11 capability flag, and keeps imported kind 9 out of the starting-message hook.🤖 Generated with Claude Code