Skip to content

fix(settings): retry cached ipc after failure#324

Closed
AkaraChen wants to merge 1 commit into
advisor/008-event-driven-git-refreshfrom
advisor/009-retryable-cached-settings-ipc
Closed

fix(settings): retry cached ipc after failure#324
AkaraChen wants to merge 1 commit into
advisor/008-event-driven-git-refreshfrom
advisor/009-retryable-cached-settings-ipc

Conversation

@AkaraChen

@AkaraChen AkaraChen commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Plan 009: Make cached settings IPC retryable

Executor instructions: Run every verification command. Update plans/README.md when done.

Drift check (run first): git diff --stat 3ee5b79..HEAD -- src/shared/lib/cachedPromise.ts src/features/settings src/features/terminal src/shared/lib/*.test.ts

Status

  • Priority: P2
  • Effort: S
  • Risk: LOW
  • Depends on: none
  • Category: bug
  • Planned at: commit 3ee5b79, 2026-06-13

Why this matters

Some settings providers cache IPC promises at module scope. If the first call fails due to transient Tauri startup timing or OS failure, the rejected promise can be reused forever until app restart. Cache successes, not permanent transient failures.

Current state

Relevant files:

  • src/shared/lib/cachedPromise.ts — generic cache helper.
  • src/features/settings/ShellPicker.tsx and nearby settings components — use cached IPC helpers for shell/font/sound-like data.

Current excerpt:

  • cachedPromise.ts memoizes a promise and does not clear it on rejection.

Commands you will need

Purpose Command Expected on success
Focused test bun run test -- cachedPromise exit 0
Full frontend bun run test && ./node_modules/.bin/tsc --noEmit && bun run lint:check exit 0

Scope

In scope:

  • cachedPromise behavior and tests.
  • Call sites only if typings change.

Out of scope:

  • Adding retry UI/toasts for every settings panel.

Git workflow

Branch advisor/009-retryable-cached-settings-ipc; commit fix(settings): retry cached ipc after failure.

Steps

Step 1: Add tests for rejection reset

Create/update src/shared/lib/cachedPromise.test.ts with cases:

  • concurrent callers share one pending promise;
  • fulfilled result is cached;
  • rejected promise clears cache so next call invokes factory again.

Verify: bun run test -- cachedPromise → fails before implementation for rejection reset.

Step 2: Clear cache on rejection

Update cachedPromise so rejected promises reset the stored promise/value. Preserve sharing of concurrent pending calls.

Verify: focused test passes.

Step 3: Full frontend validation

Run full frontend checks.

Verify: all commands exit 0.

Done criteria

  • Rejected cached calls are retryable.
  • Concurrent dedupe and success caching remain.
  • Full frontend checks pass.

STOP conditions

  • A caller relies on permanent rejection caching for control flow; report the caller and rationale.

Maintenance notes

Reviewers should ensure errors still surface to users; this only changes retry behavior.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 85e1264a-822f-4333-9aae-c68e2c9271e8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch advisor/009-retryable-cached-settings-ipc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AkaraChen AkaraChen force-pushed the advisor/009-retryable-cached-settings-ipc branch from 56f432c to d1d1046 Compare June 14, 2026 06:55

AkaraChen commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

@AkaraChen

Copy link
Copy Markdown
Owner Author

Merged as part of the stack in #331.

@AkaraChen AkaraChen closed this Jun 14, 2026
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