Skip to content

Fix silent failures in whitelist add/remove operations#119

Merged
Yashb404 merged 3 commits into
feat/keys-freshfrom
copilot/sub-pr-116-another-one
Feb 11, 2026
Merged

Fix silent failures in whitelist add/remove operations#119
Yashb404 merged 3 commits into
feat/keys-freshfrom
copilot/sub-pr-116-another-one

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 11, 2026

Whitelist modifications were silently ignoring all failures, hiding network errors and authorization issues from users while still triggering UI refetches.

Changes

  • Handle HTTP responses: Check resp.ok() before refetching whitelist data
  • Log failures: Use console::error_1 to surface HTTP errors and network failures
  • Conditional refetch: Only update UI state on successful operations
// Before: silent failure, always refetch
let _ = builder.send().await;
whitelist_resource.refetch();

// After: log errors, conditional refetch
match builder.send().await {
    Ok(resp) => {
        if resp.ok() {
            whitelist_resource.refetch();
        } else {
            web_sys::console::error_1(&JsValue::from_str(&format!(
                "Failed to add URL to whitelist: HTTP {}", resp.status()
            )));
        }
    }
    Err(e) => {
        web_sys::console::error_1(&JsValue::from_str(&format!(
            "Failed to add URL to whitelist: {:?}", e
        )));
    }
}

Applies to both add_whitelist_item and remove_whitelist_item actions in client/src/pages/view.rs.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 11, 2026 04:39
Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com>
Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on secure embed authorization implementation Fix silent failures in whitelist add/remove operations Feb 11, 2026
Copilot AI requested a review from Yashb404 February 11, 2026 04:47
@Yashb404 Yashb404 marked this pull request as ready for review February 11, 2026 04:51
@Yashb404 Yashb404 merged commit fb51be2 into feat/keys-fresh Feb 11, 2026
@Rakshat28 Rakshat28 deleted the copilot/sub-pr-116-another-one branch February 12, 2026 13:42
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.

2 participants