Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ If a required command fails or emits a warning from project code, fix it in the

## Lessons

- The advisory database can make an unchanged lockfile fail the gate. Update
vulnerable transitive crates through Cargo and replace unmaintained direct
dependencies. The `chrono` migration must preserve RFC 3339 strings in
existing rule files, cloud metadata, IPC, and diagnostic logs. Use fixed
timestamps from the previous format in round-trip tests. Reuse the diagnostic
UTC formatter because an inline formatter expanded the environment collector
past Clippy's function-length limit (ADR 0138).

- `cfg(unix)` or a non-Windows fallback does not imply Linux desktop tools
are available. macOS client download buttons must hand approved URLs to
`/usr/bin/open`; use the Homebrew OpenVPN formula page for the CLI and
verify command construction without opening a browser (ADR 0075).
- A working opener does not prove the download URL still works. Happ's
old download page returned HTTP 403 on macOS. Verify the publisher's
universal DMG through the final redirect and update both preset catalogs
so the frontend destination and native allowlist agree (ADR 0074).

- A fixed sleep does not prove a child has installed its signal handler on a
busy native runner. The graceful-stop fixture must read an explicit flushed
readiness message after handler installation, keep the child alive through
Expand Down
61 changes: 29 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ members = [
]

[workspace.package]
version = "6.2.91"
version = "6.2.94"
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.88"
Expand All @@ -28,7 +28,6 @@ publish = false
[workspace.dependencies]
async-trait = "0.1.88"
bytes = "1.10.1"
chrono = { version = "0.4.41", features = ["serde"] }
clap = { version = "4.5.38", features = ["derive"] }
dirs = "6.0.0"
flate2 = "1.1.1"
Expand All @@ -37,6 +36,7 @@ hex = "0.4.3"
http = "1.3.1"
idna = "1.0.3"
ipnet = { version = "2.11.0", features = ["serde"] }
jiff = { version = "0.2.35", features = ["serde"] }
psl = "2.1.148"
nix = { version = "0.30.1", features = ["socket", "user", "signal", "process", "fs"] }
libc = "0.2.174"
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iran-split/desktop",
"version": "6.2.91",
"version": "6.2.94",
"private": true,
"type": "module",
"scripts": {
Expand Down
23 changes: 22 additions & 1 deletion apps/desktop/src/components/ClientRegistry.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ beforeEach(() => {
pickProfileFile.mockResolvedValue("/tmp/office.ovpn");
vi.mocked(desktop.clientBinaryInstalled).mockReset();
vi.mocked(desktop.clientBinaryInstalled).mockResolvedValue(true);
vi.mocked(desktop.openUrl).mockClear();
vi.mocked(desktop.openUrl).mockReset().mockResolvedValue(undefined);
const openvpn = createClientInstance(
"openvpn",
"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
Expand All @@ -49,6 +49,7 @@ beforeEach(() => {
snapshot: baseSnapshot(),
actionPending: false,
boot: { platform: "linux" } as BootstrapResult,
toast: null,
updateClient: vi.fn(),
addClient: vi.fn(),
deleteClient: vi.fn(),
Expand Down Expand Up @@ -365,6 +366,26 @@ describe("ClientRegistry profile picker", () => {
);
});

it("reports a failed macOS OpenVPN download page handoff", async () => {
useAppStore.setState({ boot: { platform: "macos" } as BootstrapResult });
vi.mocked(desktop.openUrl).mockRejectedValueOnce("browser handoff failed");
render(<ClientRegistry />);

await userEvent.click(screen.getByRole("button", { name: "Add client" }));
const row = screen.getByTestId("client-catalog-openvpn");
await userEvent.click(
within(row).getByRole("button", { name: "Download OpenVPN" }),
);

expect(desktop.openUrl).toHaveBeenCalledWith(
"https://formulae.brew.sh/formula/openvpn",
);
expect(useAppStore.getState().toast).toMatchObject({
text: "Could not open the download page.",
tone: "danger",
});
});

it("leaves the path unchanged when the picker is cancelled", async () => {
const updateClient = vi.fn();
pickProfileFile.mockResolvedValueOnce(null);
Expand Down
7 changes: 6 additions & 1 deletion apps/desktop/src/components/ClientRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,15 @@ function DownloadLinkButton({
labelKey: PresetDownloadLink["labelKey"];
}) {
const { t } = useTranslation();
const showToast = useAppStore((state) => state.showToast);
return (
<button
type="button"
onClick={() => void desktop.openUrl(downloadUrlFor(spec, platform))}
onClick={() => {
void desktop.openUrl(downloadUrlFor(spec, platform)).catch(() => {
showToast(t("downloadPageUnavailable"), "danger");
});
}}
className="inline-flex items-center gap-1 self-start text-xs font-semibold text-brand underline"
>
<Download size={12} aria-hidden />
Expand Down
2 changes: 2 additions & 0 deletions apps/desktop/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const resources = {
stopWithStack: "Stop with stack",
downloadInstall: "Download & install",
downloadOpenVpn: "Download OpenVPN",
downloadPageUnavailable: "Could not open the download page.",
downloadWindscribeConfig: "Get Windscribe config",
directTooltip:
"Traffic leaves over your physical network with your real IP.",
Expand Down Expand Up @@ -591,6 +592,7 @@ const resources = {
stopWithStack: "توقف همراه پشته",
downloadInstall: "دانلود و نصب",
downloadOpenVpn: "دانلود OpenVPN",
downloadPageUnavailable: "صفحهٔ دانلود باز نشد.",
downloadWindscribeConfig: "دانلود کانفیگ Windscribe",
directTooltip: "ترافیک با آی‌پی واقعی از شبکه فیزیکی خارج می‌شود.",
clientDetails: "تنظیمات و میزبان‌های سنجاق‌شده",
Expand Down
Loading
Loading