Title: fix(id): avoid orphaned identities when registration is cancelled · Issue #9089 · developing-today/code · GitHub
Open Graph Title: fix(id): avoid orphaned identities when registration is cancelled · Issue #9089 · developing-today/code
X Title: fix(id): avoid orphaned identities when registration is cancelled · Issue #9089 · developing-today/code
Description: Evidence On fresh origin/main (21531e2372574bdae2483ff4bd6e527710afcc42), pkgs/id/src/web/identity.rs:300-318 explains that the registration critical section is deliberately detached so persistence and in-memory admission accounting fini...
Open Graph Description: Evidence On fresh origin/main (21531e2372574bdae2483ff4bd6e527710afcc42), pkgs/id/src/web/identity.rs:300-318 explains that the registration critical section is deliberately detached so persistence...
X Description: Evidence On fresh origin/main (21531e2372574bdae2483ff4bd6e527710afcc42), pkgs/id/src/web/identity.rs:300-318 explains that the registration critical section is deliberately detached so persistence...
Opengraph URL: https://github.com/developing-today/code/issues/9089
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(id): avoid orphaned identities when registration is cancelled","articleBody":"## Evidence\n\nOn fresh `origin/main` (`21531e2372574bdae2483ff4bd6e527710afcc42`), `pkgs/id/src/web/identity.rs:300-318` explains that the registration critical section is deliberately detached so persistence and in-memory admission accounting finish even when the request future is cancelled. The spawned task at `:325-348` persists the record and inserts it into `clients`. Only after awaiting that task does the caller create the name watcher (`:356-362`) and sign/return the token (`:365-366`).\n\nIf the `/api/identity/register` request is cancelled while the spawned task is running, the task can still finish the database write and insert the identity, while the cancelled caller never reaches watcher creation or token issuance. That leaves a registered identity that no client received a token for. Persistent stores reload/count it on restart, so repeated disconnected registrations can consume the configured identity capacity without producing usable identities. This is a source-traced cancellation interleaving; no timing-dependent runtime repro was run.\n\nThe existing detached-task rationale prevents persisted records from being under-counted, but does not cover the post-commit cancellation window or reclaim/complete the user-visible registration result.\n\n## Why it matters\n\nA client disconnect or cancellation at the wrong point can permanently consume one of the bounded identity slots while losing the only token that could authenticate that identity. Repeated occurrences can exhaust the 10,000-entry default admission capacity.\n\n## Acceptance criteria\n\n- Define and implement cancellation semantics so a cancelled registration cannot leave an unreachable identity consuming persistent or in-memory capacity (or make the completed registration result recoverable/idempotent).\n- Ensure watcher creation and persisted identity state cannot diverge when cancellation races with registration completion.\n- Add a deterministic regression test that pauses registration after the detached persistence/insertion begins, cancels the caller, resumes the operation, and asserts the chosen no-orphan/recovery contract, including reopen behavior for the persistent-store path.\n- Preserve the current concurrent-registration capacity guarantee and verify it with existing tests.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-12T23:32:44Z","url":"https://github.com/developing-today/code/issues/9089"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7bfa9f2a-14b1-d65a-da2e-a109d288f517 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D328:804E:8DD7A6:B7BBA6:6B062F8D |
| html-safe-nonce | af04cdda48a4a80bde7497e632965fdca54136c7041aeeaa919d9134e5cf5262 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzI4OjgwNEU6OEREN0E2OkI3QkJBNjo2QjA2MkY4RCIsInZpc2l0b3JfaWQiOiI3NzgxNTM5NzQ5MTcyNzUyMjY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6b63762d7a8a582fde0c6fdf2f09d997cf39f6feb8a339c17587447889b1353e |
| hovercard-subject-tag | issue:6361234701 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/9089/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c5e9a83a8b4e7270ec9ca4f2deaed659f92a0bba23f5e53ce70997132fbcfcb8/developing-today/code/issues/9089 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c5e9a83a8b4e7270ec9ca4f2deaed659f92a0bba23f5e53ce70997132fbcfcb8/developing-today/code/issues/9089 |
| og:image:alt | Evidence On fresh origin/main (21531e2372574bdae2483ff4bd6e527710afcc42), pkgs/id/src/web/identity.rs:300-318 explains that the registration critical section is deliberately detached so persistence... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 494ea0bb1e0feef734a83e2628697647755e8864 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width