cloud/C3: BLOCKED — IPC wiring needs Lead clarification#219
Closed
blueberrycongee wants to merge 1 commit intomainfrom
Closed
cloud/C3: BLOCKED — IPC wiring needs Lead clarification#219blueberrycongee wants to merge 1 commit intomainfrom
blueberrycongee wants to merge 1 commit intomainfrom
Conversation
`electron/main/ipc.ts` uses a unified `tauri-invoke` dispatcher that
fans out by command name. Each handler module is wired with three
additive lines: an import, a factory call to bind config (e.g.
configPath), and a dispatch branch. The C3 spec restricts the
existing-file edit to "a single named import" — three additive
lines exceed that, so per the task's own block condition I'm
flagging this for Lead review rather than guessing.
Two ways forward (Lead's call):
1. Approve three additive lines in `ipc.ts` (matches the existing
webdav / proxy / updater pattern; smallest possible deviation).
2. Self-register a separate `ipcMain.handle("lumina_cloud_*", ...)`
channel, importable for side effects with a single import in
`electron/main/index.ts`. Inconsistent with the rest of the
renderer's `invoke()` plumbing but technically satisfies the rule.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Apr 28, 2026
blueberrycongee
added a commit
that referenced
this pull request
Apr 28, 2026
* cloud/C6: revocation cache (in-memory until C3 unblocks) Implements a daily-refreshed cache for §2.5 revocations. The work is factored as createRevocationCache(opts) so tests can inject storage, fetchFresh, now, and ttlMs cleanly. The default singleton wires this to the real getRevocations from the C5 client. Failure modes are intentionally fail-open: - Storage read throw → treat as cold cache. - Network refresh throw → keep serving stale data; cold-and-network- down resolves to "not revoked". Revocation is defense-in-depth on top of expires_at; locking users out on a transient outage would be a worse failure than missing a freshly-revoked id for a few minutes. The default storage is in-memory only because persistent storage needs the same Electron-IPC plumbing question that has C3 blocked (PR #219). The cache still de-dupes refreshes within a session; across-restart persistence will follow when C3 unblocks. Drop-in replacement: pass a different `storage` to createRevocationCache. Concurrent refresh requests are coalesced into a single fetch via an inFlight Promise — prevents N parallel requests on first paint. Tests cover the four cases C6 lists (cold, warm, expired, network- fail-with-stale) plus cold+network-fail (fail open) and the coalescing invariant. 7 tests, all pass. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * cloud/C6: mark C6 done in TASKS.md Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: blueberrycongee <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
4 tasks
Owner
Author
|
Superseded by #240 — Lead's implicit unblock (merging the ship PRs without committing the BLOCKED marker on |
blueberrycongee
added a commit
that referenced
this pull request
Apr 28, 2026
* cloud/C3: license storage via Electron safeStorage + Linux fallback Implements the C3 acceptance after Lead implicitly approved the 3-additive-line wiring in `electron/main/ipc.ts` (block PR #219 left unaddressed; the merged ship PRs leave C3 as `[ ]` on main, making it the next pickable task). Main process: new `electron/main/handlers/luminaCloudLicense.ts` exposes three handlers: - `lumina_cloud_save_license`: encrypts via safeStorage when available, falls back to a 0600 plaintext file with a clear log line otherwise. Magic-prefixes the on-disk blob (`LCE1\n` encrypted, `LCP1\n` plaintext) so the loader can recover from a switch in encryption availability across runs. - `lumina_cloud_load_license`: reads + dispatches by prefix. Decrypt failures → null (caller will prompt for re-entry). Unknown prefix → null (treat as missing rather than crash on a future on-disk format). - `lumina_cloud_remove_license`: unlink, ENOENT-tolerant. `ipc.ts` gets exactly three additive lines: a named import, a factory call binding `userData/lumina-cloud-license.bin` and the real `safeStorage`, and a dispatch branch matching the existing webdav / proxy / updater pattern. No existing line is modified. Renderer: `src/services/luminaCloud/store.ts` becomes a thin invoke() bridge over the three IPC commands. Tests: 11 main-process tests cover encrypted round-trip, mode 0600 (POSIX only), no-file cold start, decrypt failure → null, plaintext fallback round-trip, switch in availability, defensive arg checks, and unknown-prefix → null. 5 renderer tests cover the IPC argument shape and error propagation. All 16 pass plus the existing 190 electron tests. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * cloud/C3: mark C3 done in TASKS.md Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: blueberrycongee <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Block, not implementation. Per task C3's own block condition, flagging that the existing IPC plumbing needs three additive lines — not the "single named import" the spec assumes.
The mismatch
electron/main/ipc.tshas a unifiedtauri-invokedispatcher that fans out by command name. Every existing handler module (webdav, proxy, updater, plugins, diagnostics) is wired identically:```ts
// 1. import (top of file)
import { createWebDAVHandlers } from "./handlers/webdav.js";
// 2. factory call inside registerIpcHandlers (binds config like paths)
const webdavHandlers = createWebDAVHandlers({
configPath: path.join(app.getPath("userData"), "lumina-webdav-config.json"),
});
// 3. dispatch branch
if (cmd in webdavHandlers) return webdavHandlerscmd;
```
A new `luminaCloudLicenseHandlers` would need the same three pieces. That's additive (no existing line is modified) but exceeds "a single named import in the existing main entry."
The renderer side (`src/lib/hostBridge.ts`) routes everything through `invoke('cmd_name', args)` → `tauri-invoke` channel. Self-registering with a separate `ipcMain.handle('lumina_cloud_save_license', ...)` channel would technically need only one side-effect import in `electron/main/index.ts`, but it would diverge from how `invoke()` already works for every other command in the app.
What I need from Lead
Pick one:
My recommendation is option 1. If you agree, just say "go with 3 additive lines in ipc.ts" and I'll unblock and ship the actual C3 implementation in the next iteration.
Touched files outside src/services/luminaCloud/
Notes for Lead