Repository navigation
Conversation
…the first run does
…ger waits for a page
…, whatever page it signed in on
…bered addresses still reach it
… its others at once
…eads a kept GitHub token
ShotsRendered by CI on GitHub's Windows runner, with its software renderer, at the default window size. Before is 602
i-device-joined
|
…ccount still lists it
…into another or cleared
…e person reads its notice
…e next launch and tells two computers of one name apart
… most once in ten seconds, and late ticks never burst
…r tries the next one
… ran out or a session that ended in one line, and offers the code again
… renewal calls go through a site that refuses them there
…er, and an older sign-in that starts linking at launch says so once
# Conflicts: # crates/seq-shell/src/bin/seq-node.rs
…ircle starts again or the app stops mid-removal Remove now records the removed computer in this computer's own store, in the same write as the device list, and the account never links a computer in that set on its own; a link by hand takes it out. Starting a full circle again without the computer adds it the same way. A removal cut off between the device list and the circle write is finished at the next start.
… every run the sign-in refuses The GitHub connector renewed an expired session through bare curl, so a test profile holding one posted to github.com; it now goes through github_app::Site. The gist calls asked only the profile variable; they now ask the same Site rule (a profile, or a port alone). A scan finds any GitHub App call passing bare curl, and the gate test seeds a session due for renewal so it reaches the gate.
…once it is up The GitHub keeper gave up for good when the sign-in did not start once. A start GitHub did not answer (not reached, or an answer that was not GitHub's) is now said once and tried again each minute; an answer that cannot change (GitHub refused it, or the run may not reach GitHub) still stops after one line.
…y end, not dropped The wake limiter dropped a wake that came within ten seconds of the last: a lid opened twice in that time got no network change and no backoff reset for the second wake. It is now held and done at the first tick once the ten seconds are over, once.
…ead, and a renamed computer is not said twice The joined notice's Remove ran, showed the error, and the toast then read and closed itself anyway, so a failed Remove cleared the notice with the computer still linked. The kit's try_action keeps a toast as it was when its action returns false. The notice is now found by the computer's key (Toast::about), not its name and key start, so a computer renamed while its notice shows is not said again.
…ntil read, though the launch said it before the window Contract change: the notice came from the devices://account_start event alone, so a window that was not there yet (a --background launch, or a window that subscribed after the event) never said it, and it was a plain toast newer ones pushed out. The test now starts the app the launch way and expects the notice kept until it is read.
… the store until it is read The launch that records a GitHub session as the yes now keeps a notice record in the same write as the yes, and the window reads it when it opens as well as on devices://account_start, so a --background launch or a window that opens after the event does not lose it. The notice waits to be read (until_read), so later toasts and a page's clearing never take it. CORE-API names devices_account_start and devices_account_start_seen.
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.






TL;DR
Signing in to GitHub links this computer to the person's other computers wherever the sign-in happens: first run, Settings > Profile, or
seq-node --githubon a server. When the account links a computer, each of the person's computers says so in a notice that waits to be read, with Remove, and a computer the person removed stays removed while the account still lists it, also after the circle starts again without it or the app stops mid-removal. A computer keeps the same UDP port across launches and redials its others at once after sleep or a network change.Problem
seq-nodecould link only by a typed device code, so linking by account was app-only.Cause
github::app_finishaccepted the peer notice only whenApp_.linkwas set, and only the first run'sapp_start_linkingset it. Profile calledapp_start.boot::wake_if_githubasked forNeed::Boot, which needs a recorded notice yes. A Profile sign-in never recorded one, so the node stayed off at every launch.node.rsnever startedgithub_linkand had no sign-in of its own.github_link::Linker::stepsaid the yes and marked the rowaccount, but recorded nothing anyone was told.Linker::stepchecked only the gist and the joiner'swas_removedflag. It never read the circle's own removal record, which Remove writes. That record alone can't carry it either: "Start again without it" founds a new circle that has no record of the computer, andMachine::unlinkwrote the device list and the circle in two writes, so a stop between them left the computer linked through the stored circle.iroh::bind_mainkept iroh's default0.0.0.0:0and[::]:0unless a bind address was set.start_dialdoubles the backoff up toredial_max, and only a successful register reset it. Neither a wake nor a network change did.Change
linkflag andapp_start_linkingare gone). Profile's GitHub row says so in one line before the sign-in: "Signing in links this computer to your others on this account."Need::GitHub), so a sign-in made on an older build links too. The old test row "signed in but no notice yet does not start" is a contract change, rewritten in its own commit with the reason.account_start), in the same write as the yes. The app says "This computer now links to your others on your GitHub account, since it is signed in to GitHub." in a notice that waits to be read, at launch and ondevices://account_start, and clears the record only when the notice is read. A launch notice the window missed (the event goes out before the window exists) or the person didn't read is said at the next launch. The old test that it shows once is a contract change, rewritten in its own commit.seq-node --github.node::keep_github_session).github_app::may_start_latersays no) is said once and stops.github_linkwith that session (spawn_with,token_in). It doesn't publish the friend card, since a server's user name isn't the person's name.node::By::Account).--githubwith--joinis refused.account_joined).Toast::about), so a computer renamed while its notice shows gets no second one.Toast::try_action, an action that says whether it worked). The node's start saysdevices://changed, so a record kept from before launch is said even when the window looked first.Toast::until_read, which only these notices use. Such a toast is never folded into another, pushed out by newer ones or cleared by a route change.seq-nodeprints the line and marks it told only once the line was written.devices_removesay all of this, with the newdevices_account_startanddevices_account_start_seen.devices_removed, the newest 256), written in the same write as its device list by Remove and by "Start again without it". The linker'sremoved()asks this list beside the circle's removal record, in all four linking paths (asks, held yeses, posting an invite, redeeming one).devices_unlinking) in that same write, and the circle's write clears the mark. A computer that stopped between the two finishes the removal at its next start (Machine::finish_removal), so nothing is lost between the writes.linkedforced high on its side, after a restart, after a circle started again without it, and after a stop mid-removal. Only linking it by hand in Devices takes it off the list.iroh::home_ports, 20000 to 29999). The port must be free on IPv4 and IPv6 alike, or IPv4 alone on a computer without IPv6 (free_on_both). It takes any port when all three are taken.github_app::Site, decides whether a run may reach github.com: the GitHub App sign-in and renewal, the connectors' GitHub token renewal (connectors.rsnow passesSite::here()) and the gist calls (CurlGh::calltakes its base from the sameSite). Under a debug profile every one is refused before curl runs. A source scan fails on a sign-in or renewal call that passes the bare curl.iroh.rs,iroh_net.rs,github_link.rs,github_app.rsandnode.rssay what each party sees, as listed below.Scope
What each outside party can see after this change
seq-node --github:The joined record, the launch record and the removed list never leave the person's computers. A test profile never reaches github.com.
A gist attacker
seq-node --githubasks no typed yes, so on a server nobody answers it.seq-nodeprints it. Remove now holds: a key the person removed is not linked again while it stays listed.Left alone on purpose
seq-nodehas no single-instance lock: twoseq-node --githubprocesses on one computer run two device flows.docs/PEER-CHATS-PLAN.mdanddocs/design/device-to-device.md, which don't exist in the repo. The one iniroh.rsis removed; the others are outside this change.Before and after
602is Profile signed out, now with the line under GitHub.i-device-joinedis new, so the base has no picture of it; the start of the key's fingerprint is its hover detail. The last round changed no screen, so these are the shots from the round before.seq-node --work ~/work --github --accept-noticeon a serverShots: built with the
shotfeature, scenes602andi-device-joined, light and dark, in a throwaway profile and data folder; looked at.Verification
Each of these failed before its change, for the reason the test names, and passes now:
pages::settings::account::tests::signing_in_on_profile_links_this_computerpages::settings::account::tests::the_github_row_says_signing_in_links_this_computertests::a_machine_signed_in_to_github_starts_its_node_at_boot(contract rewritten in its own commit)tests::an_older_sign_in_that_starts_linking_at_launch_says_so_oncetests::the_launch_notice_of_an_older_sign_in_is_kept_until_read(launches the app the launch way: the event goes out before the window, then a second launch on a copy of the store; it first failed to compile, on the new API; with the record planted out it fails)pages::settings::where_::devices_tests::an_older_sign_in_that_starts_linking_at_launch_says_so_until_read(contract rewritten in its own commit)tests::a_joined_record_kept_from_before_launch_is_said_once_the_node_is_upiroh::tests::a_restarted_node_keeps_its_port_and_moves_only_when_it_is_takeniroh::tests::a_home_port_is_free_only_when_both_families_have_itiroh::tests::a_node_that_wakes_from_sleep_redials_at_onceiroh::tests::a_starved_loop_wakes_at_most_once_in_ten_seconds(a fake clock: a minute of ticks seven seconds late gives at most seven resets; its control shows every one reads like a wake)iroh::tests::a_late_tick_is_not_followed_by_a_burstiroh::tests::a_second_wake_inside_ten_seconds_is_done_when_they_endpeers::iroh_net::tests::the_endpoint_asks_for_its_keys_own_port_on_every_startpeers::github_link::tests::each_computer_the_account_links_is_told_oncepeers::github_link::tests::a_computer_the_person_removed_stays_removed_while_the_account_lists_it(300 rounds on both sides with the key listed,linkedforced high and a redeem tried from the removed side, then the remover rebuilt from its store; a link by hand then works and clears the mark; each of the four paths planted out fails it)peers::github_link::tests::a_computer_removed_by_starting_the_circle_again_stays_removedpeers::github_link::tests::a_removal_cut_off_before_the_circle_was_written_still_holds(a store trigger refuses the circle write; its control reads the stored circle still naming the computer; then the store is closed and opened again; withfinish_removalplanted out it fails)peers::github_link::tests::the_gist_calls_and_the_sign_in_refuse_the_same_runsgithub_app::tests::every_github_sign_in_and_renewal_goes_through_the_site(its control finds a planted bare call)overlays::toast::tests::a_notice_that_waits_to_be_read_is_never_pushed_out_folded_or_clearedoverlays::layer::tests::an_action_that_fails_leaves_its_notice_up_and_unread(it first failed to compile, on the new API)pages::settings::where_::devices_tests::a_computer_the_account_links_is_said_once_with_remove(contract rewritten in its own commit: showing the notice no longer marks it told)pages::settings::where_::devices_tests::a_joined_notice_not_read_is_said_again_at_the_next_launchpages::settings::where_::devices_tests::a_joined_notice_is_never_pushed_out_by_other_toastspages::settings::where_::devices_tests::two_computers_of_one_name_are_two_notices_each_removing_its_ownpages::settings::where_::devices_tests::a_remove_that_fails_leaves_the_notice_up_and_unreadpages::settings::where_::devices_tests::a_computer_renamed_while_its_notice_shows_is_not_said_twicenode::tests::a_server_marks_a_computer_told_only_once_its_line_is_writtennode::tests::a_server_signs_in_beside_the_node_and_the_linker_picks_the_session_upnode::tests::a_server_whose_code_runs_out_says_so_once_and_carries_onnode::tests::a_server_whose_github_session_is_revoked_says_so_and_offers_the_code_againnode::tests::a_server_that_boots_before_its_network_signs_in_once_it_is_upnode::tests::a_server_signed_in_to_github_links_by_the_account_and_shows_no_codenode::tests::a_server_links_by_the_account_or_by_a_code_not_bothgithub_app::tests::a_test_world_never_reaches_githubThese pin behaviour that already held:
node::tests::a_server_signs_in_to_github_in_the_terminalkeeps its assertions on the new keeper.node::tests::a_server_whose_sign_in_cannot_start_says_so_once_and_stops: an answer that can't change ends the keeper with one line.github_app::tests::a_test_world_never_reaches_github(listed above) now also holds a session due for renewal, with its refresh token, under a test profile: its control renews it against a fake GitHub, and under the profile the renewal is refused and the session kept. The renewal ingithub_appalready went throughSite; the call that didn't was inconnectors.rs, which the scan test above catches.peers::github_link::tests::a_computer_the_account_links_is_a_full_member_of_the_circle: an account-linked computer is a circle member on both sides, on the same row a typed code gives. It has a negative control (a computer on another account joins no circle), and it fails whenmark_account_linkis planted out.All of these ran with no test filter, in a throwaway debug profile and data folder for the app. The native and script rows ran at this head; the others at its parent
3d203121, since the last merge frommainchanged nothing outsidenative/and docs:cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --locked -p seq-shell -p seq-peer --features seq-shell/peers,seq-peer/iroh --all-targets -- -D warningscrates/seq-shell/tests/two_computers.rs:559, a file this change doesn't touch (same onmain); 0 with that lint allowedcargo nextest run --workspace --locked(5159 tests)cargo nextest run --locked -p seq-shell --features peers(1160 tests)cargo nextest run --locked -p seq-peer --features iroh(658 tests)cargo nextest run --locked --manifest-path native/Cargo.toml --workspace -E 'not binary(launch_path)'(3818 tests)cargo nextest run --locked --manifest-path native/Cargo.toml --workspace -E 'binary(launch_path)', run without a debug profile sincelaunch_envrefuses under one by designcargo clippy --locked --manifest-path native/Cargo.toml --workspace --all-targets -- -D warningsscenes/src/chat/run_card_tests.rs:292, a file this change doesn't touch (same onmain); 0 with that lint allowednode --test 'scripts/*.test.mjs'(604 tests, 10 skipped)two_computers::a_restart_mid_sync_convergesfailed once in an earlier round, after its 90 s wait, while the machine was shared with other builds. It has passed in every run since. The cause was not found.Not verified:
network_changegoes out before the redials, and thatbind_mainpasses over a home portfree_on_bothrefuses, are covered by reading; the probe itself is tested on loopback.seq-node --githubon Linux or Windows, on a computer with no credential store, with a session GitHub really revoked, and on a server that really boots before its network.To try it on two computers and a VM:
seq-node --work ~/work --github --accept-notice. The node starts at once; enter the code at github.com/login/device and watch it print "Linked through your GitHub account." A and B say the VM joined.