Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- api/amazon_relational.py +16 -5
- api/deps.py +7 -2
- api/routes_auth.py +14 -3
- api/routes_odoo_tables.py +22 -2
- platform/core/perm_scope.py +3 -1
- platform/core/store_pg.py +20 -0
- platform/core/user_tables.py +21 -0
- platform/core/users.py +12 -2
- platform/harness/runtime.py +8 -0
- web/public/AIOS_DEPLOY_RECEIPT +1 -1
- web/src/customer-grid/CustomerGrid.tsx +14 -6
- web/src/customer-grid/types.ts +2 -2
- web/src/index.css +2 -1
RELEASES.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": []
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "a50f43e",
|
| 3 |
"releases": []
|
| 4 |
}
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
a50f43e
|
api/amazon_relational.py
CHANGED
|
@@ -415,18 +415,29 @@ def _read(cur, key):
|
|
| 415 |
return out
|
| 416 |
|
| 417 |
|
| 418 |
-
def
|
| 419 |
-
"""
|
| 420 |
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
for field in fields:
|
| 425 |
bag = field.get("link") or {}
|
| 426 |
target, frm, on = bag.get("table"), bag.get("from"), bag.get("on")
|
| 427 |
if (field.get("type") != "link" or target not in SOURCE or not frm or not on
|
| 428 |
or bag.get("inverse") or bag.get("through") or bag.get("selectionMode") == "manual"):
|
| 429 |
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 430 |
values = {str(row[frm]) for row in rows if row.get(frm) not in (None, "")}
|
| 431 |
matches = {}
|
| 432 |
for row in read_targets(target, on, values) if values else ():
|
|
|
|
| 415 |
return out
|
| 416 |
|
| 417 |
|
| 418 |
+
def link_edges(fields):
|
| 419 |
+
"""`[(field, target, from, on)]` for every derived Amazon link `fill_link_cells` fills.
|
| 420 |
|
| 421 |
+
HOTFIX 2026-09-28: the ONE predicate, so the HTTP reader can see up front every column it
|
| 422 |
+
will be asked for on a target and read a STORED target once rather than once per edge."""
|
| 423 |
+
out = []
|
| 424 |
for field in fields:
|
| 425 |
bag = field.get("link") or {}
|
| 426 |
target, frm, on = bag.get("table"), bag.get("from"), bag.get("on")
|
| 427 |
if (field.get("type") != "link" or target not in SOURCE or not frm or not on
|
| 428 |
or bag.get("inverse") or bag.get("through") or bag.get("selectionMode") == "manual"):
|
| 429 |
continue
|
| 430 |
+
out.append((field, target, frm, on))
|
| 431 |
+
return out
|
| 432 |
+
|
| 433 |
+
|
| 434 |
+
def fill_link_cells(rows, fields, read_targets):
|
| 435 |
+
"""Populate derived Amazon links with target pids, with one read per edge.
|
| 436 |
+
|
| 437 |
+
The snapshot planner reads its tenant mirror; the HTTP reader supplies a scoped
|
| 438 |
+
target reader. Neither path stores history rows or caps the matching target set.
|
| 439 |
+
"""
|
| 440 |
+
for field, target, frm, on in link_edges(fields):
|
| 441 |
values = {str(row[frm]) for row in rows if row.get(frm) not in (None, "")}
|
| 442 |
matches = {}
|
| 443 |
for row in read_targets(target, on, values) if values else ():
|
api/deps.py
CHANGED
|
@@ -829,10 +829,15 @@ def _user_for(claims):
|
|
| 829 |
if (qa and claim_tenant == qa.get("tenant")
|
| 830 |
and int(claims.get("e") or 0) == int(qa.get("epoch") or 0)):
|
| 831 |
return qa
|
|
|
|
|
|
|
|
|
|
| 832 |
try:
|
| 833 |
reg = users.registry() or {}
|
| 834 |
-
except Exception:
|
| 835 |
-
|
|
|
|
|
|
|
| 836 |
rec = reg.get(uname)
|
| 837 |
if (rec and rec.get("active", True)
|
| 838 |
and int(rec.get("epoch") or 0) == int(claims.get("e") or 0)):
|
|
|
|
| 829 |
if (qa and claim_tenant == qa.get("tenant")
|
| 830 |
and int(claims.get("e") or 0) == int(qa.get("epoch") or 0)):
|
| 831 |
return qa
|
| 832 |
+
# ⛔ HOTFIX 2026-09-28: AN UNREADABLE REGISTRY IS A 503, NEVER "NO SUCH ACCOUNT". This caught
|
| 833 |
+
# `Exception` into `{}`, so a store `PoolTimeout` on staging answered a valid cookie with 401
|
| 834 |
+
# `invalid_session` and the client signed the owner out. Still fail-closed: nobody is admitted.
|
| 835 |
try:
|
| 836 |
reg = users.registry() or {}
|
| 837 |
+
except Exception as exc:
|
| 838 |
+
print(f"[aios-api] session account store unavailable: {type(exc).__name__}: {exc}")
|
| 839 |
+
raise err(503, "session_store_unavailable",
|
| 840 |
+
"your account could not be checked just now. Try again in a moment")
|
| 841 |
rec = reg.get(uname)
|
| 842 |
if (rec and rec.get("active", True)
|
| 843 |
and int(rec.get("epoch") or 0) == int(claims.get("e") or 0)):
|
api/routes_auth.py
CHANGED
|
@@ -69,6 +69,17 @@ def _throttled(key, now=None):
|
|
| 69 |
raise _auth_store_down("_throttled", exc)
|
| 70 |
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
def _note_failure(key, now=None):
|
| 73 |
if key is None:
|
| 74 |
return 0
|
|
@@ -196,7 +207,7 @@ def login(request: Request, response: Response, body: dict = Body(default=None))
|
|
| 196 |
raise err(429, "too_many_attempts",
|
| 197 |
f"too many failed attempts. Try again in {wait} seconds")
|
| 198 |
if not user:
|
| 199 |
-
user =
|
| 200 |
if not user:
|
| 201 |
# CONSTANT-TIME-ISH 401. `users.verify` returns immediately for an unknown username (no
|
| 202 |
# record, no PBKDF2) and burns ~200k iterations for a known one, so the response time
|
|
@@ -356,7 +367,7 @@ def _mfa_credentials(uname, password):
|
|
| 356 |
print(f"[aios-api] {exc}")
|
| 357 |
raise err(429, "too_many_attempts",
|
| 358 |
f"too many failed attempts. Try again in {wait} seconds")
|
| 359 |
-
user =
|
| 360 |
if not user:
|
| 361 |
try:
|
| 362 |
users._hash(password or "x", "00" * 16)
|
|
@@ -620,7 +631,7 @@ def change_password(body: dict = Body(default=None)):
|
|
| 620 |
print(f"[aios-api] {exc}")
|
| 621 |
raise err(429, "too_many_attempts",
|
| 622 |
f"too many failed attempts. Try again in {wait} seconds")
|
| 623 |
-
user =
|
| 624 |
if not user:
|
| 625 |
try:
|
| 626 |
users._hash(pw or "x", "00" * 16)
|
|
|
|
| 69 |
raise _auth_store_down("_throttled", exc)
|
| 70 |
|
| 71 |
|
| 72 |
+
def _verify(uname, pw):
|
| 73 |
+
"""`users.verify`, with an UNREADABLE registry answered 503 before `_note_failure` runs.
|
| 74 |
+
|
| 75 |
+
HOTFIX 2026-09-28: a store `PoolTimeout` used to read as "no such account", so a correct
|
| 76 |
+
password got 401 `invalid_credentials` and was charged to the lockout budget."""
|
| 77 |
+
try:
|
| 78 |
+
return users.verify(uname, pw) if (uname and pw) else None
|
| 79 |
+
except users.RegistryUnavailable as exc:
|
| 80 |
+
raise _auth_store_down("verify", exc)
|
| 81 |
+
|
| 82 |
+
|
| 83 |
def _note_failure(key, now=None):
|
| 84 |
if key is None:
|
| 85 |
return 0
|
|
|
|
| 207 |
raise err(429, "too_many_attempts",
|
| 208 |
f"too many failed attempts. Try again in {wait} seconds")
|
| 209 |
if not user:
|
| 210 |
+
user = _verify(uname, pw)
|
| 211 |
if not user:
|
| 212 |
# CONSTANT-TIME-ISH 401. `users.verify` returns immediately for an unknown username (no
|
| 213 |
# record, no PBKDF2) and burns ~200k iterations for a known one, so the response time
|
|
|
|
| 367 |
print(f"[aios-api] {exc}")
|
| 368 |
raise err(429, "too_many_attempts",
|
| 369 |
f"too many failed attempts. Try again in {wait} seconds")
|
| 370 |
+
user = _verify(uname, password)
|
| 371 |
if not user:
|
| 372 |
try:
|
| 373 |
users._hash(password or "x", "00" * 16)
|
|
|
|
| 631 |
print(f"[aios-api] {exc}")
|
| 632 |
raise err(429, "too_many_attempts",
|
| 633 |
f"too many failed attempts. Try again in {wait} seconds")
|
| 634 |
+
user = _verify(uname, pw)
|
| 635 |
if not user:
|
| 636 |
try:
|
| 637 |
users._hash(pw or "x", "00" * 16)
|
api/routes_odoo_tables.py
CHANGED
|
@@ -3171,10 +3171,30 @@ def odoo_table_rows(table_key: str,
|
|
| 3171 |
import amazon_relational
|
| 3172 |
from routes_grid import _may_open
|
| 3173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3174 |
def read_amazon_targets(target, column, values):
|
| 3175 |
-
if not
|
|
|
|
|
|
|
| 3176 |
return []
|
| 3177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3178 |
|
| 3179 |
# Fields are the current reader's contract; target rows cross the same wall
|
| 3180 |
# as /related pins. No unscoped SQL subquery can leak a hidden target's id.
|
|
|
|
| 3171 |
import amazon_relational
|
| 3172 |
from routes_grid import _may_open
|
| 3173 |
|
| 3174 |
+
# ⛔⛔ HOTFIX 2026-09-28: ONE READ PER STORED TARGET PER REQUEST. FBA customer returns
|
| 3175 |
+
# links listings twice (`seller_sku`, `asin1`); each edge read the whole stored table, so
|
| 3176 |
+
# every page paid two tenant-document reads (~3 s each on staging, /rows 9.5 s against
|
| 3177 |
+
# /aggregates' 1 s) and a burst of group-page clicks starved the store pool until sign-in
|
| 3178 |
+
# failed. A read-through target (orders, 559k rows) keeps its `match=` SQL read per edge:
|
| 3179 |
+
# reading it whole to filter here would be far worse.
|
| 3180 |
+
_opened, _stored = {}, {}
|
| 3181 |
+
_stored_cols = {}
|
| 3182 |
+
for _f, _target, _frm, _on in amazon_relational.link_edges(fields):
|
| 3183 |
+
_stored_cols.setdefault(_target, set()).add(_on)
|
| 3184 |
+
|
| 3185 |
def read_amazon_targets(target, column, values):
|
| 3186 |
+
if target not in _opened:
|
| 3187 |
+
_opened[target] = _may_open(session, target)
|
| 3188 |
+
if not _opened[target]:
|
| 3189 |
return []
|
| 3190 |
+
if not _materialised_table(target):
|
| 3191 |
+
return _relation_rows(session, target, [column], match=(column, values))
|
| 3192 |
+
if target not in _stored:
|
| 3193 |
+
_stored[target] = _relation_rows(
|
| 3194 |
+
session, target, sorted(_stored_cols.get(target, set()) | {column}))
|
| 3195 |
+
wanted = {str(value) for value in values}
|
| 3196 |
+
# The same string comparison `_relation_rows`' own `match=` applies to a stored table.
|
| 3197 |
+
return [row for row in _stored[target] if str(row.get(column)) in wanted]
|
| 3198 |
|
| 3199 |
# Fields are the current reader's contract; target rows cross the same wall
|
| 3200 |
# as /related pins. No unscoped SQL subquery can leak a hidden target's id.
|
platform/core/perm_scope.py
CHANGED
|
@@ -1707,7 +1707,9 @@ def _read_user_table(table_key, st, want_rows=True):
|
|
| 1707 |
'reading a read-through database, or read it through the API'))
|
| 1708 |
keys = {f['key'] for f in fields if f.get('key')}
|
| 1709 |
return fields, list(_MIRROR_READER(table_key, keys, st) or ())
|
| 1710 |
-
|
|
|
|
|
|
|
| 1711 |
if whole is None:
|
| 1712 |
# Deleted between the wall and here. The same refusal, not an empty table.
|
| 1713 |
raise UnknownTable(f"no database named '{table_key}'")
|
|
|
|
| 1707 |
'reading a read-through database, or read it through the API'))
|
| 1708 |
keys = {f['key'] for f in fields if f.get('key')}
|
| 1709 |
return fields, list(_MIRROR_READER(table_key, keys, st) or ())
|
| 1710 |
+
# HOTFIX 2026-09-28: this table's entry alone where the store can (`get_one`), not a deep
|
| 1711 |
+
# copy of every table in the tenant. Amazon link cells read listings here on every page.
|
| 1712 |
+
whole = ut.get_one(table_key, st=st)
|
| 1713 |
if whole is None:
|
| 1714 |
# Deleted between the wall and here. The same refusal, not an empty table.
|
| 1715 |
raise UnknownTable(f"no database named '{table_key}'")
|
platform/core/store_pg.py
CHANGED
|
@@ -468,6 +468,22 @@ def _get_projections(names, drop=(), tenant_slug=None, timeout_s=None):
|
|
| 468 |
}
|
| 469 |
|
| 470 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
def _get_many(names, tenant_slug=None):
|
| 472 |
"""Several ordinary documents in one round trip, keyed by requested store key."""
|
| 473 |
keys = list(dict.fromkeys(str(name) for name in (names or ()) if str(name)))
|
|
@@ -838,6 +854,10 @@ class PgStore:
|
|
| 838 |
"""Bound multi-key read used by request-scoped read snapshots."""
|
| 839 |
return _get_many(names, tenant_slug=self.tenant_slug)
|
| 840 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 841 |
def _read_strict(self, name):
|
| 842 |
"""Interface parity with the HF Store. There, `get` is lenient (swallows a transient
|
| 843 |
failure) and `_read_strict` opts out so a failed read ABORTS a read-modify-write instead
|
|
|
|
| 468 |
}
|
| 469 |
|
| 470 |
|
| 471 |
+
def _get_entry(name, entry, tenant_slug=None):
|
| 472 |
+
"""ONE top-level entry of document `name` (`value -> entry`), or None when either is absent.
|
| 473 |
+
|
| 474 |
+
HOTFIX 2026-09-28. Private for `_get_projections`' reason: an optimization offered by a bound
|
| 475 |
+
`PgStore` handle, never a store operation, so callers keep their whole-read fallback. A
|
| 476 |
+
stored `ut_*` table read this way crosses the wire as that table alone, not the whole
|
| 477 |
+
`user_tables` document (~60-100 MB on staging, ~3 s per read, holding a pool connection).
|
| 478 |
+
"""
|
| 479 |
+
with _pool().connection() as con:
|
| 480 |
+
row = con.execute(
|
| 481 |
+
_q('SELECT value -> %s FROM {tbl} WHERE key = %s', 'store_kv', tenant_slug),
|
| 482 |
+
(str(entry), str(name))).fetchone()
|
| 483 |
+
value = row[0] if row else None
|
| 484 |
+
return dict(value) if isinstance(value, dict) else None
|
| 485 |
+
|
| 486 |
+
|
| 487 |
def _get_many(names, tenant_slug=None):
|
| 488 |
"""Several ordinary documents in one round trip, keyed by requested store key."""
|
| 489 |
keys = list(dict.fromkeys(str(name) for name in (names or ()) if str(name)))
|
|
|
|
| 854 |
"""Bound multi-key read used by request-scoped read snapshots."""
|
| 855 |
return _get_many(names, tenant_slug=self.tenant_slug)
|
| 856 |
|
| 857 |
+
def get_entry(self, name, entry):
|
| 858 |
+
"""Bound single-entry read; None means absent, and the caller falls back to `get`."""
|
| 859 |
+
return _get_entry(name, entry, tenant_slug=self.tenant_slug)
|
| 860 |
+
|
| 861 |
def _read_strict(self, name):
|
| 862 |
"""Interface parity with the HF Store. There, `get` is lenient (swallows a transient
|
| 863 |
failure) and `_read_strict` opts out so a failed read ABORTS a read-modify-write instead
|
platform/core/user_tables.py
CHANGED
|
@@ -1597,6 +1597,27 @@ def get(table_key, st=None):
|
|
| 1597 |
return all_tables(st).get(str(table_key))
|
| 1598 |
|
| 1599 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1600 |
# --- DURABLE MAP ZONES -------------------------------------------------------
|
| 1601 |
# Zones intentionally do not live in a view config: a view is a person's presentation of rows,
|
| 1602 |
# while a named geographic boundary is tenant data used by several views and routes. Keeping a
|
|
|
|
| 1597 |
return all_tables(st).get(str(table_key))
|
| 1598 |
|
| 1599 |
|
| 1600 |
+
def get_one(table_key, st=None):
|
| 1601 |
+
"""`get`, reading ONLY this table's entry when the bound store can (HOTFIX 2026-09-28).
|
| 1602 |
+
|
| 1603 |
+
`get` deep-copies the whole tenant document to answer for one table. On a Postgres-backed
|
| 1604 |
+
runtime `get_entry` reads `value -> table_key` instead, so a 1,168-row stored table no longer
|
| 1605 |
+
costs a ~60-100 MB read. ⛔ A `_Lent` handle is never bypassed: its `__getattr__` would forward
|
| 1606 |
+
`get_entry` to the runtime and skip the snapshot the pass was promised, so it takes `get`.
|
| 1607 |
+
Anything else (no capability, an absent entry, a failed read) falls back to `get` unchanged.
|
| 1608 |
+
"""
|
| 1609 |
+
if st is not None and not isinstance(st, _Lent):
|
| 1610 |
+
reader = getattr(st, 'get_entry', None)
|
| 1611 |
+
if callable(reader):
|
| 1612 |
+
try:
|
| 1613 |
+
one = reader(STORE_KEY, str(table_key))
|
| 1614 |
+
except Exception: # noqa: BLE001
|
| 1615 |
+
one = None
|
| 1616 |
+
if isinstance(one, dict):
|
| 1617 |
+
return one
|
| 1618 |
+
return get(table_key, st)
|
| 1619 |
+
|
| 1620 |
+
|
| 1621 |
# --- DURABLE MAP ZONES -------------------------------------------------------
|
| 1622 |
# Zones intentionally do not live in a view config: a view is a person's presentation of rows,
|
| 1623 |
# while a named geographic boundary is tenant data used by several views and routes. Keeping a
|
platform/core/users.py
CHANGED
|
@@ -566,6 +566,15 @@ def registry():
|
|
| 566 |
return store.get('users')
|
| 567 |
|
| 568 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 569 |
def ensure_bootstrap():
|
| 570 |
"""Seed an 'admin' account from APP_PASSWORD ONLY on a truly fresh store (no users file yet).
|
| 571 |
|
|
@@ -700,6 +709,7 @@ def verify(username, pw):
|
|
| 700 |
|
| 701 |
``APP_PASSWORD`` may have seeded the first admin record, but it is never consulted here. A
|
| 702 |
missing/unreachable registry therefore fails closed instead of minting an MFA-exempt identity.
|
|
|
|
| 703 |
"""
|
| 704 |
username = (username or '').strip().lower()
|
| 705 |
if not username or not pw:
|
|
@@ -707,8 +717,8 @@ def verify(username, pw):
|
|
| 707 |
try:
|
| 708 |
# read fresh so accounts created moments ago (UI or out-of-band) are recognised at once
|
| 709 |
reg = store.get('users', fresh=True)
|
| 710 |
-
except Exception:
|
| 711 |
-
|
| 712 |
username, u = _resolve_identifier(reg, username)
|
| 713 |
# ⛔ KEY FIRST, EMAIL SECOND, AND SINCE WAVE 37 THAT ORDER IS A DECISION RATHER THAN AN ACCIDENT.
|
| 714 |
# R8 lets a username BE an email address, so a typed string can now match a registry KEY and a
|
|
|
|
| 566 |
return store.get('users')
|
| 567 |
|
| 568 |
|
| 569 |
+
class RegistryUnavailable(RuntimeError):
|
| 570 |
+
"""The account registry could not be READ, which is not the same fact as "no such account".
|
| 571 |
+
|
| 572 |
+
HOTFIX 2026-09-28: `verify` used to fold a failed read into `{}`, so a busy store (a
|
| 573 |
+
`PoolTimeout` on staging) answered a CORRECT password with "that username and password do
|
| 574 |
+
not match" and charged the attempt to the lockout budget. Still fail-closed: the caller
|
| 575 |
+
answers 503, it never admits anyone."""
|
| 576 |
+
|
| 577 |
+
|
| 578 |
def ensure_bootstrap():
|
| 579 |
"""Seed an 'admin' account from APP_PASSWORD ONLY on a truly fresh store (no users file yet).
|
| 580 |
|
|
|
|
| 709 |
|
| 710 |
``APP_PASSWORD`` may have seeded the first admin record, but it is never consulted here. A
|
| 711 |
missing/unreachable registry therefore fails closed instead of minting an MFA-exempt identity.
|
| 712 |
+
An unreadable registry raises `RegistryUnavailable` rather than reading as an unknown user.
|
| 713 |
"""
|
| 714 |
username = (username or '').strip().lower()
|
| 715 |
if not username or not pw:
|
|
|
|
| 717 |
try:
|
| 718 |
# read fresh so accounts created moments ago (UI or out-of-band) are recognised at once
|
| 719 |
reg = store.get('users', fresh=True)
|
| 720 |
+
except Exception as exc:
|
| 721 |
+
raise RegistryUnavailable(f'{type(exc).__name__}: {exc}') from exc
|
| 722 |
username, u = _resolve_identifier(reg, username)
|
| 723 |
# ⛔ KEY FIRST, EMAIL SECOND, AND SINCE WAVE 37 THAT ORDER IS A DECISION RATHER THAN AN ACCIDENT.
|
| 724 |
# R8 lets a username BE an email address, so a typed string can now match a registry KEY and a
|
platform/harness/runtime.py
CHANGED
|
@@ -204,6 +204,14 @@ class TenantRuntime:
|
|
| 204 |
answer = reader([store_key for _name, store_key in keyed])
|
| 205 |
return {name: answer.get(store_key, {}) for name, store_key in keyed}
|
| 206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
def revision(self, name):
|
| 208 |
"""Return the tiny durable change token for this tenant's addressed bucket."""
|
| 209 |
return self._store().revision(self.store_key(name))
|
|
|
|
| 204 |
answer = reader([store_key for _name, store_key in keyed])
|
| 205 |
return {name: answer.get(store_key, {}) for name, store_key in keyed}
|
| 206 |
|
| 207 |
+
def get_entry(self, name, entry):
|
| 208 |
+
"""One top-level entry of `name` when the bound store offers it, else None (HOTFIX
|
| 209 |
+
2026-09-28). None also means absent; either way the caller falls back to `get`."""
|
| 210 |
+
reader = getattr(self._store(), "get_entry", None)
|
| 211 |
+
if not callable(reader):
|
| 212 |
+
return None
|
| 213 |
+
return reader(self.store_key(name), entry)
|
| 214 |
+
|
| 215 |
def revision(self, name):
|
| 216 |
"""Return the tiny durable change token for this tenant's addressed bucket."""
|
| 217 |
return self._store().revision(self.store_key(name))
|
web/public/AIOS_DEPLOY_RECEIPT
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
7f76aab0536401a1643b0cb58869d49e23ccf8b2ce16bbe2f84941fb741e2d67
|
web/src/customer-grid/CustomerGrid.tsx
CHANGED
|
@@ -4399,7 +4399,9 @@ function CustomerGridSurface({
|
|
| 4399 |
...windowRequest(offset),
|
| 4400 |
related: relatedPin,
|
| 4401 |
group: { by, key: groupKeyRaw.get(key) ?? null },
|
| 4402 |
-
}).then((page) => {
|
|
|
|
|
|
|
| 4403 |
if (seq !== groupPageSeq.current) return;
|
| 4404 |
setGroupPages((prev) => {
|
| 4405 |
const cur = prev.get(key);
|
|
@@ -4440,7 +4442,9 @@ function CustomerGridSurface({
|
|
| 4440 |
groupKey: key,
|
| 4441 |
aggs: h.aggs,
|
| 4442 |
...(h.count > pageSize
|
| 4443 |
-
? { page: { offset: page?.offset ?? 0, total: h.count, size: pageSize
|
|
|
|
|
|
|
| 4444 |
: {}),
|
| 4445 |
});
|
| 4446 |
}
|
|
@@ -4571,7 +4575,7 @@ function CustomerGridSurface({
|
|
| 4571 |
recomputed on scroll, and clamped to the rows the grid box can show. */
|
| 4572 |
const [groupPagers, setGroupPagers] = useState<
|
| 4573 |
{ key: string; top: number; left: number; height: number;
|
| 4574 |
-
page: { offset: number; total: number; size: number } }[]
|
| 4575 |
>([]);
|
| 4576 |
useLayoutEffect(() => {
|
| 4577 |
const box = gridBoxRef.current?.getBoundingClientRect();
|
|
@@ -11917,9 +11921,13 @@ function CustomerGridSurface({
|
|
| 11917 |
</>
|
| 11918 |
)}
|
| 11919 |
{groupPagers.map((gp) => (
|
| 11920 |
-
|
|
|
|
|
|
|
|
|
|
| 11921 |
style={{ top: gp.top, left: gp.left, height: gp.height }}>
|
| 11922 |
-
<button type="button" className="cg-pager-btn"
|
|
|
|
| 11923 |
onClick={() => goGroupPage(gp.key, Math.max(0, gp.page.offset - gp.page.size))}>
|
| 11924 |
Previous
|
| 11925 |
</button>
|
|
@@ -11927,7 +11935,7 @@ function CustomerGridSurface({
|
|
| 11927 |
{pageLabel(gp.page.offset, gp.page.size, gp.page.total)}
|
| 11928 |
</span>
|
| 11929 |
<button type="button" className="cg-pager-btn"
|
| 11930 |
-
disabled={gp.page.offset + gp.page.size >= gp.page.total}
|
| 11931 |
onClick={() => goGroupPage(gp.key, gp.page.offset + gp.page.size)}>
|
| 11932 |
Next
|
| 11933 |
</button>
|
|
|
|
| 4399 |
...windowRequest(offset),
|
| 4400 |
related: relatedPin,
|
| 4401 |
group: { by, key: groupKeyRaw.get(key) ?? null },
|
| 4402 |
+
}).then((page) => page, () => null).then((page) => {
|
| 4403 |
+
// HOTFIX 2026-09-28: a REJECTED fetch settles too. Without the rejection handler above a
|
| 4404 |
+
// network failure left `pending` true forever and the group's pager stayed disabled.
|
| 4405 |
if (seq !== groupPageSeq.current) return;
|
| 4406 |
setGroupPages((prev) => {
|
| 4407 |
const cur = prev.get(key);
|
|
|
|
| 4442 |
groupKey: key,
|
| 4443 |
aggs: h.aggs,
|
| 4444 |
...(h.count > pageSize
|
| 4445 |
+
? { page: { offset: page?.offset ?? 0, total: h.count, size: pageSize,
|
| 4446 |
+
// HOTFIX 2026-09-28: an open group with no page yet is loading its first.
|
| 4447 |
+
pending: page ? page.pending : true } }
|
| 4448 |
: {}),
|
| 4449 |
});
|
| 4450 |
}
|
|
|
|
| 4575 |
recomputed on scroll, and clamped to the rows the grid box can show. */
|
| 4576 |
const [groupPagers, setGroupPagers] = useState<
|
| 4577 |
{ key: string; top: number; left: number; height: number;
|
| 4578 |
+
page: { offset: number; total: number; size: number; pending?: boolean } }[]
|
| 4579 |
>([]);
|
| 4580 |
useLayoutEffect(() => {
|
| 4581 |
const box = gridBoxRef.current?.getBoundingClientRect();
|
|
|
|
| 11921 |
</>
|
| 11922 |
)}
|
| 11923 |
{groupPagers.map((gp) => (
|
| 11924 |
+
/* HOTFIX 2026-09-28: while this group's page loads, both buttons are disabled and
|
| 11925 |
+
the label dims. Clicks used to stack a request each, every one discarded but the
|
| 11926 |
+
last, so the pager looked dead and the burst starved the server. */
|
| 11927 |
+
<div key={gp.key} className="cg-group-pager" aria-busy={gp.page.pending || undefined}
|
| 11928 |
style={{ top: gp.top, left: gp.left, height: gp.height }}>
|
| 11929 |
+
<button type="button" className="cg-pager-btn"
|
| 11930 |
+
disabled={gp.page.pending || gp.page.offset <= 0}
|
| 11931 |
onClick={() => goGroupPage(gp.key, Math.max(0, gp.page.offset - gp.page.size))}>
|
| 11932 |
Previous
|
| 11933 |
</button>
|
|
|
|
| 11935 |
{pageLabel(gp.page.offset, gp.page.size, gp.page.total)}
|
| 11936 |
</span>
|
| 11937 |
<button type="button" className="cg-pager-btn"
|
| 11938 |
+
disabled={gp.page.pending || gp.page.offset + gp.page.size >= gp.page.total}
|
| 11939 |
onClick={() => goGroupPage(gp.key, gp.page.offset + gp.page.size)}>
|
| 11940 |
Next
|
| 11941 |
</button>
|
web/src/customer-grid/types.ts
CHANGED
|
@@ -2860,8 +2860,8 @@ export type VisibleRow =
|
|
| 2860 |
groupKey: string;
|
| 2861 |
aggs: Record<string, string>;
|
| 2862 |
/** HOTFIX 2026-09-23: per-group paging, the page this footer's group is showing. Absent
|
| 2863 |
-
* when the group fits on one page. */
|
| 2864 |
-
page?: { offset: number; total: number; size: number };
|
| 2865 |
};
|
| 2866 |
|
| 2867 |
/** Multi-level sort: ordered = precedence (each key breaks ties within the prior). */
|
|
|
|
| 2860 |
groupKey: string;
|
| 2861 |
aggs: Record<string, string>;
|
| 2862 |
/** HOTFIX 2026-09-23: per-group paging, the page this footer's group is showing. Absent
|
| 2863 |
+
* when the group fits on one page. `pending` (HOTFIX 2026-09-28): that page is loading. */
|
| 2864 |
+
page?: { offset: number; total: number; size: number; pending?: boolean };
|
| 2865 |
};
|
| 2866 |
|
| 2867 |
/** Multi-level sort: ordered = precedence (each key breaks ties within the prior). */
|
web/src/index.css
CHANGED
|
@@ -472,7 +472,8 @@ body {
|
|
| 472 |
}
|
| 473 |
.cg-group-pager .cg-pager-btn { padding: 2px 10px; }
|
| 474 |
.cg-pager-size select { font: inherit; font-size: var(--lp-fs-2xs); padding: 2px 4px; }
|
| 475 |
-
.cg-pager[aria-busy="true"] .cg-pager-label
|
|
|
|
| 476 |
/* The view-switch pending bar: the rows stay painted underneath it. */
|
| 477 |
.cg-view-pending {
|
| 478 |
position: absolute;
|
|
|
|
| 472 |
}
|
| 473 |
.cg-group-pager .cg-pager-btn { padding: 2px 10px; }
|
| 474 |
.cg-pager-size select { font: inherit; font-size: var(--lp-fs-2xs); padding: 2px 4px; }
|
| 475 |
+
.cg-pager[aria-busy="true"] .cg-pager-label,
|
| 476 |
+
.cg-group-pager[aria-busy="true"] .cg-pager-label { opacity: 0.6; }
|
| 477 |
/* The view-switch pending bar: the rows stay painted underneath it. */
|
| 478 |
.cg-view-pending {
|
| 479 |
position: absolute;
|