Skip to content

fix: support backend account search - #5

Open
lhiro wants to merge 1 commit into
PastKing:mainfrom
lhiro:featzh/account-backend-search
Open

fix: support backend account search#5
lhiro wants to merge 1 commit into
PastKing:mainfrom
lhiro:featzh/account-backend-search

Conversation

@lhiro

@lhiro lhiro commented Aug 31, 2026

Copy link
Copy Markdown

Scope

  • Update account list query behavior in mail-worker/src/service/account-service.js.
  • Update account list request wrapper in mail-view/src/request/account.js.
  • Update account sidebar search in mail-view/src/layout/account/index.vue.
  • Update transfer account selector in mail-view/src/views/transfer/index.vue.
  • Add a defensive D1 user.lang schema guard in mail-worker/src/service/user-service.js for deployments that have not applied the latest column yet.

State Impact

  • Account sidebar no longer derives a filtered list from already-loaded client state; it replaces the account array with backend search results and keeps existing cursor pagination.
  • Transfer selector stores the current selected account separately so remote search responses do not drop the selected option unexpectedly.
  • Rebuild scope is limited to the account sidebar and transfer selector state.

Network Impact

  • GET /account/list now accepts an optional email keyword and searches account email/name on the backend.
  • Account sidebar search and transfer account selector now trigger backend requests with a 300ms debounce.
  • Existing list size cap and cursor pagination are preserved.
  • Request sequence guards discard stale responses to avoid duplicate/out-of-order UI updates.

Startup Impact

  • No new startup task.
  • Initial account loading still uses the existing /account/list request.
  • Expected added startup cost: none.
  • Parallelism: unchanged.

Resource Lifecycle

  • Search debounce timers are cleared on component unmount in both changed Vue components.
  • No new streams, controllers, subscriptions, media resources, or long-lived buffers.

i18n Impact

  • No new user-visible copy was added.
  • Existing localized labels/messages remain unchanged.

Codegen Impact

  • No @riverpod, @freezed, @JsonSerializable, or generated model changes.
  • No code generation required.

Analyze Result

  • npm run build passed for mail-view.
  • npx wrangler deploy --dry-run passed for mail-worker.
  • git diff --check passed.

Risk and Rollback Plan

  • Risk: backend LIKE search on large account tables may read more rows than the previous first-page-only flow, but it fixes accounts that are outside the first page and keeps the 100-row page cap.
  • Rollback: revert this PR to return account search to the previous client-side filtering behavior.

Notes

  • Verified the target remote D1 account search condition can find an account beyond the first page, e.g. xigege.edu@v0v.ai.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant