Commit 349ecd0
committed
CS-11264 fix CI: fast-path reconciler.mounted + insert registry row in test
The 2c65f87 follow-up moved _realm-auth's registry-presence check to
`knownByUrl + DB probe` (mirroring multiRealmAuthorization). That's
correct for production but missed two test-mode realities that
multiRealmAuthorization handles by checking `realms[]` first:
1. `registerExistingMounts` (used by runTestRealmServer and the
legacy pre-Phase-3 boot path) puts realms into
`reconciler.mounted` but DELIBERATELY does NOT put them in
`knownByUrl` — so the reconcile-time unmount phase doesn't tear
legacy mounts down when they're absent from realm_registry.
Test 258 ("creates session rooms when missing") trips this:
testRealm is in `mounted` but not `knownByUrl` and not in the
DB, so the handler skipped it and returned an empty sessions
map.
2. The new regression test (259) asserts `knownByUrl.has(...)` as a
precondition, but the test fixture's testRealm never gets a
realm_registry row inserted, so that precondition was always
false — the test was checking a state that never existed in
test mode.
Fixes:
- `handle-realm-auth.ts`: add `reconciler.mounted` as the first
fast-path in the lookup order, mirroring multiRealmAuthorization
exactly. A realm currently mounted on this process is
authoritatively present — the registry probe is the slow fallback
for cases where it isn't.
- `realm-auth-test.ts`: in test 259, insert a `realm_registry` row
via `insertSourceRealmInRegistry` and call
`testingOnlyReconcile()` before eviction. The test now exercises
the "registry row exists, realm absent from realms[] and
reconciler.mounted" path it claims to.1 parent bd90109 commit 349ecd0
2 files changed
Lines changed: 34 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
67 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
68 | 80 | | |
69 | 81 | | |
70 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
123 | 139 | | |
124 | 140 | | |
125 | 141 | | |
| |||
0 commit comments