Repository navigation
Phone test build: every open evilnet/seance PR and the translation popover together (do not merge) - #7
Open
rdrake wants to merge 54 commits into
Open
Phone test build: every open evilnet/seance PR and the translation popover together (do not merge)#7rdrake wants to merge 54 commits into
rdrake wants to merge 54 commits into
Conversation
nefarious2 read the spec's `SEARCH in=#chan;text=foo` as one long `in=`, so its profile spelled the selectors out as separate parameters, the text last. evilnet/nefarious2#152 makes m_search read soju's form, as soju itself does, so the profile's searchParams and the hook it filled are gone: every server gets specSearchParams. A line break no longer has to be refused before sending: the one parameter escapes it, as it always did for other servers. The scenario checks the wire in the new spelling. An older nefarious2 answers the new form with FAIL SEARCH INVALID_PARAMS in, so this waits on evilnet#152.
Ban... on a nick's menu, and a new menu on the user@host in join, part and quit lines, open a dialog in the oper tools' style: the mask with suggested shapes, who it catches as you type, warnings when it would catch you, is already covered or replaces narrower bans, and a kick to go with it. The Bans window replaces the old table, in the channel browser's look: search by word or by a pasted address (which finds the ban catching it), filters, sorts, Unban with an undo, "Unban these N", add and edit, and other ops' changes arrive live. "List banned users", /banlist and a typed MODE #chan b all open it. Changes go out one line at a time, each waiting for its ACK, so the throttle is respected and a ban the server silently ignores is reported rather than shown as done. Extban wording lives in the nefarious profile. Kick no longer hides itself on networks without half-ops. The new strings are English in the other languages until translated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ags, +reply - CAP: a LIST reply spread over lines keeps every line, and an ACK spread over lines changes nothing until its last line. - BATCH: the type is an opaque identifier, matched exactly. - PRIVMSG/NOTICE: client tags (reply, edit) only go out once message-tags is enabled. - Replies and reactions carry the ratified +reply alongside +draft/reply; +reply is read first. The service worker's notification reply does the same. - ISUPPORT: a run of \xHH escapes is decoded as UTF-8, falling back to one byte per character.
disconnect() closes the socket, but the transport reports the close later. A connect or a transport swap in between lost that event: a redial makes WsTransport ignore the old socket, and a swap unsubscribes from it. onClose() never ran, so channels stayed JOINED with their old user lists, and batches, pending messages, SASL and the rest carried over into the new connection. The client now remembers that a close it asked for is still unreported and runs the teardown itself before redialling or swapping. The STS upgrade, which disconnects and reconnects in one go, settles quietly: its own lobby line already says why.
…age-tags - STS: a CAP NEW naming sts is handled like the final CAP LS. Over wss:// it stores or refreshes the policy; over ws:// it upgrades, also after registration: the session is torn down at once (the disconnect race fix this builds on), channels are rejoined quietly over wss://, and settings edited for the same host keep the secure endpoint. - REDACT whose target is our own nick (a private message) is applied to the query with the sender, and the line for an unloaded message is translated. - canRedact also needs message-tags, which the draft depends on.
- multiline: no batch is all blank lines (the draft forbids it; nefarious2's FAIL dropped the rest of the message). Blank lines where a later batch would start are left out; leading ones are kept with text. - webpush: draft/webpush is requested bare too and its key read from the VAPID 005 token as the spec has it, nefarious2's vapid= cap value still first; both go through the same check, and = padding and other cap tokens are accepted. The service worker's renewal takes the keys from PushSubscription.toJSON() (a real subscription has no .keys). A refused UNREGISTER no longer marks push blocked. - metadata: the private visibility parameter on SET is nefarious2's, so it moves to its profile (privateMetadata). Our keys are for the account's own sessions only, so a server that cannot keep them private gets none of them, and the payload tier is no longer rewritten on every read there. Until a connection's 004 names the server, writes stay private. FAILs for our own keys are recognised in the spec's shapes with the target first. - chathistory: draft/chathistory-end closes 'load older' after a full page too; search context and reply-parent lookups, which go by msgid, are not sent to a server whose MSGREFTYPES leaves msgid out.
nefarious2 gives up on slow or silent services after FEAT_SASL_TIMEOUT (10 s) with "904 :SASL authentication failed: request timed out", before our own 12 s timer. That 904 was taken for a wrong password: with SASL required the client quit and called onSaslRejected, so a network whose services lagged once stopped connecting by itself. SaslAuth now marks a 904 transient when its text says the server timed out, or when it arrives before the credentials went out (it cannot be a refusal of them). saslProgress treats a transient failure like its own timeout: QUIT, abandon the socket, and let the usual reconnect follow.
test/formal/handshake models Seance's CAP 302 / SASL PLAIN handshake against nefarious2's registration gate and SASL relay, across every combination of caps offered and refused, services up or down, password, required SASL, a client that ends CAP early, and timely or slow peers. replay.ts (run by mocha) replays every model behaviour into the real IrcClient and fails on any line Seance sends that the model would not; live_server.py plays the model's client against a running ircd. On ircv3.2-upgrade all 990 server behaviours matched. The model found the server-timeout misreading fixed in the previous commit (NoFalseRejection). Two gaps stay open and are written up in the README, with the properties they break in Findings.cfg: a NAKed REQ that carried sasl loses the pipelined opener, and our timer can beat services.
A server that lists other mechanisms (908) will not take PLAIN on the next connection either, so that 904 must not be retried as transient.
Review against Solanum, InspIRCd, UnrealIRCd, Atheme, Anope, Ergo and X3 sources: a 904 before the credentials went out is not an outage. Atheme and Anope refuse EXTERNAL without a client certificate that way, and Ergo's USER password can land there, so retrying looped for good. Only a 904 whose text names an outage (timed out, service unavailable) is transient now, plus a 906 we did not ask for: nefarious2 sends it when the services link splits mid-exchange, Solanum without services and UnrealIRCd on its own timeout. The 908 special case goes with the rule it guarded. The model gains the split (ServerAgentLost) and dumps how Seance left (outcome). replay.ts now asserts it against onSaslRejected and transport.abandon: the same QUIT line hid the difference, so reverting the fix passed before; it now fails 12 of 279 behaviours. gen.sh fails when TLC does, and an empty fixture fails the replay.
A Marian model that translates into several languages reads the target
as a token in front of the source (>>por<< hello), so one repo can serve
several pairs. translation.cpu.opus now takes {model, token, name,
sizeBytes} for a pair as well as a bare repo: the service hands the
pair's token to the seq2seq engine on each request, which puts it in
front of the text. Pairs that share a repo share its download and its
pipeline, and Settings counts that download once. name replaces
"OPUS-MT" in the model's label; sizeBytes replaces an OPUS-MT pair's
113 MB in Settings and the download question.
Review follow-up: each pair keeps a repo of its own, since a model's download, Settings row and load state are keyed by the repo; the deploy name is left out; the service sets only the route's token, dropping any token a caller set; a pair whose token is not a string is dropped, and sizeBytes must be a positive integer.
sasl-3.1 says the client MUST enable sasl before using AUTHENTICATE. Pipelining the opener behind the CAP REQ broke that, and when the REQ was NAKed the server dropped the opener with it: the one-at-a-time retry never sent it again, so the login waited out 12 s and reconnected into the same NAK. sasl-3.2 has a server NAK sasl when its authentication layer is gone, so a conforming server reaches this. pipelineEnd now leaves the opener to maybeEnd while sasl is outstanding. It costs one round trip and no extra command (registration lines are not charged fake lag). A NAK of sasl alone now reports "the server refused the sasl capability" with nothing opened. "unavailable" joins the outage texts: nefarious2's Keycloak path says "introspection unavailable" when it cannot reach Keycloak. In the model, LoggedInWhenPossible and WelcomedWhenPossible now hold in every world, NAKs included, so the no-NAK restrictions are gone. Replay matches 319 client views; the live ircd matches 864 of 864 behaviours.
# Conflicts: # tools/scenarios/history-search.mjs
A REQ after CAP END and before 001 holds registration until another END (capability-negotiation; nefarious2's cap_req does it too). The property holds only because nefarious2 sends CAP NEW to registered clients alone.
Waiting for the ACK before AUTHENTICATE left no timer running until the REQ was answered, so a server that never answered it held a required login open for good. The SASL timer now starts when CAP END is held back for sasl (CapNegotiator.onHold). If it runs out with nothing opened, it fails as a timeout: QUIT and reconnect with SASL required, CAP END without. A late ACK then opens nothing. The model's timer covers the wait too; dropping onHold fails 68 of 387 replayed behaviours. The README lists the outage rule's limits: a server misconfigured into 906 is retried every minute, and outages that send the bare 904 still read as a wrong password.
…o share its download
A pair may carry a name, which Settings shows in place of "OPUS-MT"
(translate.model.namedPair: "{name} {from} → {to}"). Pairs that name
one repo, such as the two directions of a bidirectional model, now get
a catalog id each (the repo and the pair) and keep the repo as their
copies' source. Each pair keeps its own Settings row, load state and
down-mark. The cache answers and deletes by the source, the service
marks every sharing pair's row when the download arrives or goes, and
Settings counts and removes the download once.
…gin's bare 904 retry instead of ending the network A phone brought back after a long time away often did not reconnect at all, and the cause was on the login path. nefarious2 gives up on slow services or a slow Keycloak at 10 s (SASL_TIMEOUT, m_sasl.c abort_sasl), before the client's own 12 s timer, and says so with `904 :SASL authentication failed: request timed out`; the client took every 904 as a wrong password: QUIT, the network down for good and autoconnect switched off, so a later cold start never dialled either. Services not linked (`904 :… service unavailable`, and `sasl` left out of CAP LS by sasl_server_available()) or split mid-exchange (906) ended the same way. A phone coming back after hours meets exactly that slow path. saslFailed takes a SaslFailureCause: - `server`: our timeout, the server's own, "unavailable", or a 906 the server sent mid-exchange (sasl.ts isServerSideFailure). QUIT, transport.abandon(), the usual schedule -- the path our own timeout already took. - `unavailable`: no usable sasl cap, or a NAK. Retried like `server` on a network where this account has logged in before (irc/saslTrust.ts: thelounge.state.saslOk, uuid -> account, never in the settings backup; forgotten when the credentials are edited, when a refusal is final and when the network is removed), final anywhere else. - `unexplained`: a bare 904, which nefarious2 sends for a wrong password and for a Keycloak it cannot reach alike. A login that has worked here gets SASL_TRUSTED_RETRIES (3) more connections in a row, reset by a success; otherwise final. - `refused`: missing credentials, 902, 905, 907. Final, as before; a final failure still stays down, forgets the login and turns autoconnect off. Tests: test/irc/client-sasl.ts "the server could not check the login", test/irc/sasl.ts "isServerSideFailure". Docs: irc-layer.md's SASL paragraph, seamless-reconnect.md round nine (which also records the reconnect-timing parts of the first cut that evilnet#170, evilnet#172 and evilnet#155 superseded). Ported onto this branch: strings go through t(), and since the opener now waits for the sasl ACK, a NAKed sasl opens nothing. The retry rule replaces the branch's own SaslResult.transient, which reached the same server-side set (906, "timed out", "unavailable").
…, no false "not connected" lines, trust forgotten without a client A Keycloak outage could still end the network. Keycloak down is a bare 904 at every attempt, and nefarious2 withdraws `sasl` and offers it again meanwhile (its health timer reports success from a cached admin token without reaching Keycloak), so the trusted retries ran out inside the outage and the final refusal forgot the login and turned autoconnect off: the cold start this branch is about never dialled. A trusted login that runs out of retries now stays down for this connection only, keeps the login and the autoconnect, says so (SASL_TRUSTED_GAVE_UP_HINT), and the next connect, the user's or a page load's, gets the retries again. A retried failure abandoned the socket from inside the negotiator's `beforeEnd`; the `CAP END` flush handlers/cap.ts then sent went to the dropped socket, and every line of it was reported as sent while disconnected. `client.socketOpen` gates the flush, `finalLines` and `registrationAwayLine` (which otherwise set state for lines that never went out); `startSasl`'s missing-cap branch clears `saslOk`. Trust was forgotten only through a live client. Now the bus edit handler forgets it when the credentials differ from the saved entry's (a blank password field keeps the remembered one), `rememberNetwork` when the connect form's differ (`typedCredentialsDiffer`: a password the entry does not remember starts untrusted at every sign-in, where the user is at the keyboard to read a refusal), `saved-networks.ts remove` beside its other forgets (the Networks page's Delete), and a restore clears the key (CLEARED_ON_RESTORE). Minor: `applyPendingOptions` forgets credentials edited while the old login ran and succeeded; once the user has disconnected a failure ends with its report, so no `closeExplained` is left to swallow the next real drop's; the comment on SASL_TRUSTED_RETRIES says minutes, not seconds. Tests: test/irc/client-sasl.ts (expectRetried pins the two error lines; the trusted login that runs out keeps the login and retries at the next connect; an edit during the exchange; a disconnect during a retryable 904), test/irc/saslTrust.ts (new), test/irc/multi-network.ts (an edit with no live client), test/irc/saved-networks.ts (removal), test/helpers/settingsBackup.ts (restore). Ported onto this branch: the gave-up hint is connect.saslTrustedGaveUpHint through t(), beside saslRequiredHint().
- A pair given as an object always has the repo and the pair as its id, so a second pair on its repo never moves the first's id and consent. - A pair whose repo another pair has, is downloading or was agreed to is not asked about again. - The download question and the declined-download reason use the deploy's name too (helpers/translateWhy.ts). - The in-page fake and the service rig answer by the repo, as the real cache does; the view update is one helper (applyCached).
The environment gains `trusted` (the login has worked on this network, saslTrust.ts). A trusted login retries a NAK or a missing sasl (cause unavailable) and its first bare 904 (unexplained); an untrusted one leaves as before. New invariant TrustedKeepsNetwork: a trusted login never turns autoconnect off. replay.ts trusts the login for those behaviours and gives each one a fresh trust store (a success trusts it). 774 client views match; breaking the unavailable rule fails 13 of them. The live ircd matches 1728 of 1728 behaviours.
…e channel menu The mentions pane's look becomes one shared set of classes, so a pane under a header button is built from it instead of styled again: .header-popover-container (the v-backdrop over #viewport), .header-popover (the surface; the whole chat under the header on a phone), .header-popover-title with its .header-popover-aside and .header-popover-close, placed by helpers/headerPopover.ts placeUnder. The themes that styled .mentions-popup style .header-popover instead. TranslationPanel.vue is now one of these: under the channel menu's ⋮, the same title row as the mentions, the sections and hints in every layout, formality as the segmented control everywhere, controls 2.25rem with a pointer and 2.75rem under a finger. It closes through its own escape layer (so Android's Back closes it too), keeps Tab inside with trapTab, and a press outside closes it and does what the header button there says, as the mentions pane does. The segmented control no longer leaves an empty third cell under two choices, and takes the pane's own colours rather than the composer's (black on black on zelenzy). The channel header's translate button is gone: "Translation…" in the channel menu is the one way in, and the panel's switch is reading's on/off. Its nine tooltip strings leave the pot and the catalogs. Context menu icons get a 1.5rem box with the glyph centred, so the language glyph (a full 1.25em) no longer runs into its label. Docs: client-features.md § Header popovers, translation.md § The channel's panel. The translation scenarios open the panel through the menu (lib/translation.mjs openTranslationPanel, READING_ON).
Review of the evilnet#180 port. When sasl was already NAKed or DELed and some other cap's reply never came, the ACK deadline failed as a slow server (cause server), so an untrusted required login reconnected for good instead of being refused. The deadline now fails as unavailable when sasl itself is settled, through the same saslCapLost the beforeEnd hook uses, which also stops the timer once there is nothing to wait for. disconnect() stops it too: with the close event late, an optional login reported a timeout and sent CAP END to a closed socket. The model's timer makes the same distinction (its server answers sasl last, so it never reaches the case; the client test does). The TrustedKeepsNetwork comment says it covers a first connection only.
- Escape closes the panel while the focus is in one of its fields too: the app's binding ignores keys typed in a field, so the pane takes Escape itself (@keydown.esc, as SourceLanguagePicker.vue does). - A header popover never runs past the bottom of #viewport, the visible band, so a short window or iOS's keyboard cannot push the panel's Settings link out of reach. - An engine's pause showed only in the removed header button's label: the panel now says "Translation is paused for now: <reason>" while it lasts (translate.panel.paused). - The chosen segment is marked by a ring with the label in the body's ink; link-coloured text on its own wash fell under 4.5:1 on light themes. Increase Contrast rings it in the body colour. - Settings' intro no longer sends people to the header button (translate.settings.intro, fuzzy in every catalog until retranslated); translate.unavailable.lead's context and references drop Chat.vue; the catalogs' references follow the pot (merge.ts). - The panel is aria-modal, as the other dialogs that trap Tab are, and is exempt from .screen-overlay like the mentions pane (its phone rule is .header-popover's own). - translate-reading.mjs: three controls share a width, the hints show, the reading switch is picked by place (the interface is French by then). - Stale comments about the old sheet; logical border on the foot.
…ick sticks
With a send target set, a pause in typing previews the translation in the
strip and Return sends it; a Return before the preview is done waits for it.
The translate button names the target (EN → PT) instead of a placeholder
that wrapped on a phone, the strip loses its Send and Edit buttons, and a
translated line's label is a quiet "from Portuguese" ("sent in" for your
own) under the text.
The source picked with the channel's target is kept (writeFrom) and used
for every draft instead of guessing; a guess with no route here falls back
to the reading language. The language dialog no longer focuses its select
on a touch screen (iOS opened its list unasked), docks to the chat pane and
closes when the sidebar opens.
A Return waiting on a preview that ends with no strip (the draft needs no translation, or the target moved) is answered once instead of dropped; a waiting send is keyed on the whole draft, so adding or removing /me cancels it, and it no longer pulls the focus back. Only real typing previews, not a channel switch or ArrowUp. The source picked with the target still lets a draft typed in the target go as typed, and is cleared with the target or when the panel sets one. The button's EN → PT and the read-back's colon come from the catalog, and the strip's label is no longer upper-cased.
The translate button now opens a language sheet in place of the two selects: I write / They read with a swap, the languages the channel has been written in lately as chips, a search by either name, and every language with what picking it costs (its model's download size, Corrects spelling, or Not available here with the reason on a tap). Picking under They read applies at once; Off turns the target off. A channel whose recent lines are mostly in another language offers to write in it on a card above the composer, declined per channel (channelStore noSuggest).
A header with the title, Turn off and a close button. Languages nothing here can translate into go last under one heading instead of a label on every row, and the pair and rows are slimmer.
…g on The strip loses its filled box: a thin rule, muted label, smaller text and read-back. Picking a send language in another language also switches the channel's reading on, since the replies come back in it.
In a channel that writes the reader's language, an "English" chip on every line was noise. Only a line the detector could not place keeps its "?" mark; the toolbar's Translate still translates either.
A translated line's "from German" floats at the end of its first line instead of taking a row, and the composer preview's label and Copy sit beside the text with the read-back on one line. An own line the reader got back unchanged shows no "=" chip and no "sent in" label.
A line detection skipped (unplaceable or already in the reading language) and a line the engine handed back unchanged now render nothing under the message. Both were noise on short chat lines; the toolbar's Translate still translates any of them.
The reader translated every line the detector could not place, with the source left to the engine, and a channel declaring the reading language plus one other placed every short line in the other by declaration. On an English channel that read "lol" and "Yeah?" as Polish. Now a line is left alone when it cannot be placed, or is placed only on a weak hint or thin evidence (the short-line word lookup, or franc on fewer than five words) in a language the channel is not known to write (its declared languages and prior). Thin verdicts no longer feed the prior, and the declared-language shortcut for short lines needs exactly one declared language that is not the reading one. The toolbar's Translate still translates any skipped line.
The channel prior learned only from franc verdicts, never from the
function-word classifier that places most English, so a few of the
user's own Polish sends made an English channel's prior Polish, and
that prior then broke English/Polish ties as Polish ("I know what to do
tho" read as Polish).
The prior now learns from any confident verdict on someone else's line
(not weak, thin, prior-settled or too short; never the user's own). A
tie the prior broke against the reading language is left alone. A long
line franc cannot place, or only leans toward, still translates when
the reading language is not among its contenders; short ones do not.
The composer's translate button now shows while the device probe is
still running, instead of appearing when it lands and shifting the
input on every app load.
A done translation now stands where the original message stood, with a small flipper before it (TranslationFlip.vue) that swaps the original back in one tap, like the header topic's flipper. The second row under the message and its "from …" label are gone; the flipper's tooltip says where the line came from. Nothing renders while a line is pending, so it swaps in once instead of streaming into a row that then vanishes. A failure keeps its row with the reason and retry. The translated line's menu (show original, copy, retranslate, from another language) moves to the message toolbar's Translate.
franc, the function-word classifier and the 800-word lookup placed "uncanny" and "I know what to do tho" in Polish. Two identifiers now read each line, fastText's lid.176 and ELD, and a line is placed only where they agree, or where one of them stands alone with the reading language nowhere among fastText's top three. A line neither is sure of is left alone. On 339 hand-labelled chat lines (tools/translate-eval/lid.mts), 1 English line in 166 is placed in another language (it was 7), and 83% of the foreign lines are placed right (it was 47%). The identifiers load in their own chunk, js/lid.js, and the model and wasm come from js/lid/.
The fa-language icon before a translated line was the only thing that swapped the translation and the original. Now a tap on the text does it, and the icon is just a marker that shows which one is up. A tap on a link, nick, channel or spoiler inside the line still goes to that, and so does the end of a selection or long press and the tap that closes an open toolbar. The toolbar's menu keeps the swap for keyboard users.
When reading needed a model that wasn't on the device, it opened the download dialog, and on iOS it opened the system's language-pack sheet as soon as a new language turned up. Now reading asks nothing: - A copy of 128 MB or less (an OPUS-MT pair, a deploy's per-language models) downloads without asking, unless the connection reports itself metered. - When reading needs a bigger model, the line shows "Needs a <size> download · Download" in place of the failure. The tap is the yes, and the line retries with the download's progress shown on it. - On iOS, reading takes only packs that are already installed. The table translates the line now, and the first line translated from that pair shows "Apple can translate <language> on this device · Get it", which opens the sheet. The composer, which the user is actively waiting on, still asks in the dialog and still offers the sheet.
This branch was previously 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.
A throwaway build for testing on a phone, published as a Pages preview. It is upstream
develop(e861183) with these evilnet/seance PRs merged in: evilnet#209, evilnet#210, evilnet#211, evilnet#212, evilnet#213, evilnet#214 and evilnet#203, then evilnet#215 and evilnet#208. It also has the fork branchclaude/project-thread-f2nesd(the translation panel as a header popover, opened from the channel menu only) andclaude/apple-sheet-once(Apple's language download sheet offered one at a time, and not at all once one is declined or the Apple engine is switched off).evilnet#180 is left out: evilnet#215 carries its work.
Merging evilnet#215 conflicted in
client/js/irc/client.ts(both sides kept),client/js/irc/handlers/privmsg.tsanddocs/resources/bus-contract.md(both taken from the newer develop side). Merging evilnet#208 conflicted in the server profile, where itsdescribeBanis kept and itssearchParamsdropped because evilnet#203 removed it. An earlier conflict, intools/scenarios/history-search.mjs(a browser scenario, not shipped), was resolved to upstream's version. Lint, typecheck and the full mocha suite pass on the result.Do not merge; close when testing is done.