[Bug] Передать periodic read lifecycle Query owners и учитывать eligibility #54

Closed
opened 2026-10-11 21:48:56 +03:00 by codex-bot · 0 comments
Owner

Problem

useScreenSync каждые 30 минут manual-refetch всех resources без isEnabled/isFetching. Short search/unresolved UID/session gates обходятся; scope/return facade никто не читает. App focus defaults противоречат portfolio policy; only-test observe/plural APIs добавляют альтернативные paths.

Expected Behavior

Active eligible queries владеют periodic GET; inactive inputs не запрашиваются. Native migration сохраняет осмысленные cadence/cache/identity guarantees.

Evidence

Audit date 2026-10-11; 05, 04, Complexity. IDs FE-003, ARCH-003, CPLX-001, DRY-010, DEAD-004, DEAD-005, FLOW-002, FLOW-008, TA-F07, CA-H12, CA-H14. Revision c8821200ce699dab1ce65360d1968d5877a2e78b; Confidence High mechanism/Medium equivalence; Verification status static.
Affected: screen-sync.ts:7–61; App.tsx:13–20; bond/api/queries.ts:97–104; resource-query.ts:69–149; authenticated-query.ts:15–32,61; initial-availability.ts:10–46; history hook:52–76.

Scope

In scope

Common readiness correction, eight consumers, agreed focus/reconnect/mount/hidden-tab policy, query-native interval; only-test API pruning после caller proof.

Out of scope

Global polling registry, direct fetch bypass, removal session/access/cache fence, backend public observe retirement, uniform staleTime вместо business decision.

Proposed Approach

Immediate shared enabled/not-fetching guard; native refetchInterval у existing owners после multi-observer proof. Scope/facade удаляются вместе с migrated live timer. Prior-only unused fields/plural hook удалить только при current inventory; automatic invalid-cursor recovery оставить.

Acceptance Criteria

  • Short q/unresolved UID/signed-out дают 0 GET на tick; enabled transition даёт корректный GET без cancel/restart active read.
  • Observer ownership, focus/reconnect/mount/background cadence явно выбраны; portfolio focus prohibition соблюдён, banking policy не меняется автоматически.
  • Key/session/connection switch не применяет late old result; cached successful data и HTTP-only retry сохранены; unmount останавливает periodic work.
  • Screen descriptors/unused facade и only-test observe/plural branches удалены в доказанной closure; live wrappers/initial wait/cursor recovery прежние.

Verification

Existing screen-sync/resource/auth/client MSW+fake time, production App options, два observers same key; final frontend verify и relevant keyboard/browser proof при UI change.

Dependencies

Нет; T11 backend compatibility не blocker client-only API pruning.

Traceability

Campaign WealthLedger/main#23 . Findings FE-003, ARCH-003, CPLX-001, DRY-010, DEAD-004, DEAD-005, FLOW-002, FLOW-008, TA-F07, CA-H12, CA-H14. WealthLedger/frontend; T20.

<!-- wealthledger-audit:2026-10-11:query-read-lifecycle --> ## Problem useScreenSync каждые 30 минут manual-refetch всех resources без isEnabled/isFetching. Short search/unresolved UID/session gates обходятся; scope/return facade никто не читает. App focus defaults противоречат portfolio policy; only-test observe/plural APIs добавляют альтернативные paths. ## Expected Behavior Active eligible queries владеют periodic GET; inactive inputs не запрашиваются. Native migration сохраняет осмысленные cadence/cache/identity guarantees. ## Evidence Audit date `2026-10-11`; [05](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/05-frontend-architecture-report.md), [04](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/04-dead-code-and-legacy-report.md), [Complexity](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/previous/complexity-audit.md). IDs FE-003, ARCH-003, CPLX-001, DRY-010, DEAD-004, DEAD-005, FLOW-002, FLOW-008, TA-F07, CA-H12, CA-H14. Revision `c8821200ce699dab1ce65360d1968d5877a2e78b`; Confidence High mechanism/Medium equivalence; Verification status static. Affected: [screen-sync.ts:7–61](https://git.personal.ksv741.ru/WealthLedger/frontend/src/commit/c8821200ce699dab1ce65360d1968d5877a2e78b/src/features/tbank-connection/model/screen-sync.ts#L7-L61); App.tsx:13–20; bond/api/queries.ts:97–104; resource-query.ts:69–149; authenticated-query.ts:15–32,61; initial-availability.ts:10–46; history hook:52–76. ## Scope ### In scope Common readiness correction, eight consumers, agreed focus/reconnect/mount/hidden-tab policy, query-native interval; only-test API pruning после caller proof. ### Out of scope Global polling registry, direct fetch bypass, removal session/access/cache fence, backend public observe retirement, uniform staleTime вместо business decision. ## Proposed Approach Immediate shared enabled/not-fetching guard; native refetchInterval у existing owners после multi-observer proof. Scope/facade удаляются вместе с migrated live timer. Prior-only unused fields/plural hook удалить только при current inventory; automatic invalid-cursor recovery оставить. ## Acceptance Criteria - [ ] Short q/unresolved UID/signed-out дают 0 GET на tick; enabled transition даёт корректный GET без cancel/restart active read. - [ ] Observer ownership, focus/reconnect/mount/background cadence явно выбраны; portfolio focus prohibition соблюдён, banking policy не меняется автоматически. - [ ] Key/session/connection switch не применяет late old result; cached successful data и HTTP-only retry сохранены; unmount останавливает periodic work. - [ ] Screen descriptors/unused facade и only-test observe/plural branches удалены в доказанной closure; live wrappers/initial wait/cursor recovery прежние. ## Verification Existing screen-sync/resource/auth/client MSW+fake time, production App options, два observers same key; final frontend verify и relevant keyboard/browser proof при UI change. ## Dependencies Нет; T11 backend compatibility не blocker client-only API pruning. ## Traceability Campaign https://git.personal.ksv741.ru/WealthLedger/main/issues/23 . Findings FE-003, ARCH-003, CPLX-001, DRY-010, DEAD-004, DEAD-005, FLOW-002, FLOW-008, TA-F07, CA-H12, CA-H14. WealthLedger/frontend; T20.
codex-bot added this to the Technical Audit Remediation — 2026-10-11 milestone 2026-10-11 21:48:56 +03:00
codex-bot added the Kind/Bug
Priority
Medium
3
audit/2026-10-11
labels 2026-10-11 21:48:56 +03:00
codex-bot was assigned by hermes-agent 2026-10-12 00:04:19 +03:00
hermes-agent added this to the WealthLedger — Delivery Board project 2026-10-12 00:04:19 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/frontend#54