rfc: namespace#7001
Conversation
There was a problem hiding this comment.
RFC + plumbing for "public namespaces" markdown (#privacy.simplex, @alice.simplex). Adds a SimplexName Format variant, the parser hook, mobile UI to show an "upgrade required" alert when a known-but-unimplemented name reference is seen, and new chat item types across the bot/TypeScript/Python type packages. Also includes an updated mkValidName and a simplexmq bump.
Blocking issues
1. Mobile JSON field-name mismatch on SimplexNameInfo. Haskell emits nameTLD: SimplexTLD (per bots/api/TYPES.md, packages/simplex-chat-client/types/typescript/src/types.ts, packages/simplex-chat-python/.../types/_types.py). iOS (ChatTypes.swift:5142-5147) and Android (ChatModel.kt:4734-4739) declare the field as namespace: SimplexNamespace. Default Decodable / kotlinx.serialization use the property name as the JSON key, so any payload with the new field throws a decode error. Because nameInfo is the non-optional payload of Format.simplexName, the failure bubbles up through Format → FormattedText → [FormattedText] → the enclosing ChatItem: any incoming message containing #name.simplex or @alice.simplex won't decode and won't display on either mobile client, and the "Please upgrade the app" alert that this PR adds for that exact case never fires either (parseSimpleXMarkdown returns nil when the format array fails to decode). Suggestions inline rename both type and field to match.
2. scripts/nix/sha256map.nix not updated for the simplexmq bump. The last commit moved cabal.project:24 to tag: 7682999505642de7dc0f407d85b1eea62f3abdf0, but scripts/nix/sha256map.nix:2 still only has the entry for 3e39044c4d8eaa4b1e5aeb705f187165055c5b17. Nix builds will fail until the hash is regenerated and added (no inline suggestion — needs nix-prefetch-git).
Minor
src/Simplex/Chat/Library/Commands.hs:5547-5558— the oldmkValidNameis left as a commented-out block above the new implementation. Inline suggestion removes it.src/Simplex/Chat/Markdown.hs:69-70— stray double blank line betweenFormat's deriving clause andmentionedNames. Inline suggestion removes it.
Notes / things ruled out
- The new
mkValidNamerewrite is internally consistent withtests/ValidNames.hs. The dual-pass (secretP' <|> nameRefP '#' <|> secretFallback) parser change inMarkdown.hsrelies on attoparsec's backtracking<|>, which is correct forData.Attoparsec.Text.Parser. Pre-existing precedence (#secret#still parses as Secret, not as a name) is preserved by the test suite changes. - Whether a particular short string like
#unformattedactually resolves to aSimplexNameInfois driven bystrDecodein simplexmq, which isn't in this repo — the markdown tests assume it succeeds; if the upstream parser is stricter the assertions change, but that's an upstream coupling, not a defect here.
No description provided.