[Bug] Показывать source metadata и local read recovery в investment views #55
Closed
opened 2026-10-11 21:48:56 +03:00 by codex-bot
·
2 comments
No Branch/Tag Specified
Labels
Clear labels
Kind/Dependencies
Kind/Investigation
Kind/Process
Kind/Refactor
audit/2026-10-11
kind/investigation
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Dependency update or dependency-management work
Research or decision required before implementation
Developer workflow, CI/CD, tooling, or process improvement
Internal code or configuration restructuring without new product behavior
Technical Audit Remediation — 2026-10-11
Нужна проверка evidence до решения; runtime-дефект не утверждается
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Milestone
No items
No Milestone
Technical Audit Remediation — 2026-10-11
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: WealthLedger/frontend#55
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Account VM source теряется в container props; Income loaded API отбрасывает time/attempt. Cached investment transport errors скрываются, sections не дают GET retry. Quiet tests закрепляют отсутствие feedback, отрицательный selector даже использует прежний label.
Expected Behavior
Сохранённые суммы остаются, source freshness/attempt и client failure различимы, affected query восстанавливается local read-only retry.
Evidence
Audit date
2026-10-11; 05, 03. IDs FE-001, FE-002, DRY-004, TQ-004, RISK-005, TA-F05. Revisionc8821200ce699dab1ce65360d1968d5877a2e78b; Confidence High; Verification status static.Affected: AccountPage.tsx:13–34; AccountPage.vm.ts:125–135; Income VM:110–119; InstrumentSection:22–28,76–84; section.ts:14–27; shared/api/client.ts:162–179, resource-query.ts:37–67; AccountPage.test.tsx:751–895.
Scope
In scope
Source/client feedback в account/accounts/income/operations/events/search/detail sections, existing status renderer, named query retries и общий access-loss membership predicate.
Out of scope
Fetching во view, global error store, manual T-Bank import button, удаление cached snapshot, расширение Accounts subset recovery codes.
Proposed Approach
Page VM передаёт source и separate transport feedback. Permanent access loss имеет прежние navigation/clearing actions; taxonomy predicate общий, действия локальны. Не дублировать alerts source и transport одного смысла.
Acceptance Criteria
Verification
Existing AccountPage/Accounts/Income/Stock/Bond/resource/client RTL/MSW suites; actual VM→container→view route и failed-response completion. Frontend final verify; accessibility names/keyboards по touched UI.
Dependencies
Нет для existing metadata wiring. New original forecast window приходит из backend T02 только в отдельном Events contract task T27.
Traceability
Campaign WealthLedger/main#23 . Findings FE-001, FE-002, DRY-004, TQ-004, RISK-005, TA-F05. WealthLedger/frontend; T21.
Partially done: PR #133 merged (squash, develop
9619dc9), CI green. The Issue stays open: AC 2, 3 and 5 are not met (see below).Owner decisions
frontend-user-feedbackandfrontend-data-resilienceforbid technical read warnings, "time of receipt" notices for background reads and manual retry buttons on these screens. So the cached-503 nonblocking warning and local GET retry (AC 2, the retry part of AC 3) were not implemented. Source metadata (server time, staleness, last hourly attempt) was added where the code lost it, in line with the "Resource сохраняется после неуспешной часовой попытки" scenario.INVALID_TBANK_TOKEN,NOT_FOUND,TBANK_NOT_CONNECTED), not four; plus a separateUNAUTHORIZED. Accounts' two-code subset was not widened.Change
source(VM →AccountPage→AccountPageEmpty→ existingSourceSyncStatus);sourcemoved to the sharedAccountPageContent.source: analytics.meta; loaded view rendersSourceSyncStatusfor full and empty results. Time comes frommeta.lastSuccessfulAt, not the browser clock.isBrokerageAccessLoss(code)inshared/api/problem-details.ts, used byclient.ts(isPermanentCode= predicate +UNAUTHORIZED),resource-query.ts(cache invalidation) andAccountPage.vm.ts(local copy removed). Page actions were not merged.Evidence
npm run verify:openapi:check,tsc -b, eslint--max-warnings=0,test:lint, vitest coverage (74 files / 553 tests), knip, depcruise ×2,tsc -b+ vite build, storybook build — exit 0. CI (PR run) success.AC status
UNAUTHORIZED; temporary/unknown codes are not access loss (unit test).Not verified / limits
API contract (backend ↔ frontend)
No contract change in this PR. Backend#55 added
UpcomingEventsDto.window: {from, to}(additive); the frontendopenapi.jsonsnapshot does not have it yet — regeneration is the separate task T27, nothing in the current client breaks.Done. PR #136 merged (squash, develop
8ce1e8e), CI green. All five AC are checked; the Issue is closed (AC 1 and 4 were delivered earlier in PR #133,9619dc9).Decision chain
frontend-user-feedback/frontend-data-resilienceforbade read warnings and retry buttons, so AC 2/3/5 were postponed (owner: "spec wins").0469756) — warning + "Повторить" only after the automatic retries are exhausted, same GET (no sync), success clears the warning; screens: Account, Accounts, Income, Operations, Events, instrument detail sections. Search, chart range, cards and connection settings stay quiet.Change (PR #136)
shared/api/read-failure.ts:isReadFailureExhausted(query inerror; not brokerage access loss, notUNAUTHORIZED) andreadRetry([...queries])(refetch only the failed ones;retrying). No retry counter of its own:fetchAppReadmakes 3 attempts inside onequeryFnand Queryretryisfalse, so anerrorquery means the automatic retries are done; during a manual retry the state stayserror, so the warning does not flicker.shared/ui/ReadRetry(Alert,role="status",aria-live="polite") andReadRetryButton(forStateView); stringsinvestment.readFailed"Не удалось обновить данные",investment.retry"Повторить".section()(each section retries only its own GET, so sections recover independently).UNAUTHORIZEDnever get the button; their previous actions are kept.Evidence
readRetry,ReadRetry,section().npm run verify:openapi:check,tsc -b, eslint--max-warnings=0,test:lint, vitest coverage (77 files / 580 tests), knip, depcruise ×2, build, storybook build — exit 0.Not verified / limits
ReadRetry.InvestmentRefreshStateanduseScreenSync().retryare still not used by any page (removal out of scope). Events filters decision stays in WealthLedger/frontend#63.API contract
No change in this PR (OpenAPI
UpcomingEventsDto.windowwas delivered earlier in frontend#134 / PR #135).