Checking in progress, though not fully working as expected

This commit is contained in:
Ryan Ward
2026-07-27 11:41:20 -05:00
parent 856a6cd6f3
commit 309000a303
51 changed files with 74 additions and 3315 deletions
+2 -6
View File
@@ -130,11 +130,7 @@ pub fn init(app: &mut AppContext) {
]);
if ChannelState::enable_debug_features() {
let crash_description = if cfg!(target_os = "macos") {
"Crash the app (for testing sentry-cocoa)"
} else {
"Crash the app (for testing sentry-native)"
};
let crash_description = "Crash the app (for testing)";
app.register_editable_bindings([
EditableBinding::new("workspace:crash", crash_description, WorkspaceAction::Crash)
.with_context_predicate(id!("Workspace")),
@@ -146,7 +142,7 @@ pub fn init(app: &mut AppContext) {
.with_context_predicate(id!("Workspace")),
EditableBinding::new(
"workspace:panic",
"Trigger a panic (for testing sentry-rust)",
"Trigger a panic (for testing)",
WorkspaceAction::Panic,
)
.with_context_predicate(id!("Workspace")),
+1 -40
View File
@@ -31,8 +31,6 @@ use std::convert::TryFrom;
#[cfg(target_os = "macos")]
use std::env;
use std::fmt::Write;
#[cfg(all(target_os = "macos", feature = "crash_reporting"))]
use std::fs;
use std::path::{Path, PathBuf};
#[cfg(target_os = "macos")]
use std::process;
@@ -110,8 +108,6 @@ use pathfinder_geometry::rect::RectF;
use repo_metadata::repositories::DetectedRepositories;
#[cfg(feature = "local_fs")]
use repo_metadata::RemoteRepositoryIdentifier;
#[cfg(all(target_os = "macos", feature = "crash_reporting"))]
use sentry::protocol::{Attachment, AttachmentType};
use serde_json;
use session_sharing_protocol::common::SessionId as SharedSessionId;
#[cfg(target_family = "wasm")]
@@ -22623,10 +22619,6 @@ impl Workspace {
context.set.insert(flags::CLOUD_CONVERSATION_STORAGE_FLAG);
}
if privacy_settings.is_crash_reporting_enabled {
context.set.insert(flags::CRASH_REPORTING_FLAG);
}
if editor_settings.cursor_blink.value() == &CursorBlink::Enabled {
context.set.insert(flags::CURSOR_BLINK_CONTEXT_FLAG);
}
@@ -24479,8 +24471,7 @@ impl TypedActionView for Workspace {
self.dismiss_ai_assistant_warm_welcome(ctx);
}
Crash => {
#[cfg(feature = "crash_reporting")]
crate::crash_reporting::crash();
log::warn!("Crash testing is unavailable in Galaxy");
}
Panic => {
panic!("WorkspaceAction::Panic triggered from command palette");
@@ -25349,36 +25340,6 @@ impl TypedActionView for Workspace {
Ok(Ok(output)) if output.status.success() => {
ctx.open_file_path_in_explorer(Path::new(&output_path));
#[cfg(feature = "crash_reporting")]
if ChannelState::channel().is_dogfood() {
// For dogfood process samples, we raise a sentry warning with the sample attatched.
// We do this so that our performance bot can then read through the performance logs
// in sentry and write up a report of findings/possible optimizations.
if let Ok(sample_data) = fs::read(&output_path) {
let filename = Path::new(&output_path)
.file_name()
.map(|f| f.to_string_lossy().to_string())
.unwrap_or_else(|| "process_sample.txt".to_string());
let attachment = Attachment {
buffer: sample_data,
filename,
ty: Some(AttachmentType::Attachment),
..Default::default()
};
sentry::with_scope(
|scope| {
scope.add_attachment(attachment);
},
|| {
sentry::capture_message(
"[FOR PERFORMANCE BOT] Dev took performance sample with results: ",
sentry::Level::Warning,
)
},
);
}
}
format!("Process sample saved to {output_path}")
}
Ok(Ok(output)) => {