some more

This commit is contained in:
Meghan Denny
2025-10-17 23:11:16 -07:00
parent ecf2f222c5
commit f02013ef7e
10 changed files with 25 additions and 29 deletions

View File

@@ -2679,6 +2679,14 @@ export function reportAnnotationToBuildKite({ context, label, content, style = "
if (!isBuildkite) {
return;
}
// https://buildkite.com/docs/agent/v3/cli-annotate
// > The annotation body can be supplied as a command line argument, or by piping content into the command. The maximum size of each annotation body is 1MiB.
if (content.length > 1024 * 32) {
content = content.slice(content.length - 1024 * 32); // trim to the last 32kb of the message
content = content.slice(content.indexOf("\n")); // don't cutoff in the middle of a line
}
const { error, status, signal, stderr } = nodeSpawnSync(
"buildkite-agent",
["annotate", "--append", "--style", `${style}`, "--context", `${context || label}`, "--priority", `${priority}`],

View File

@@ -1306,13 +1306,7 @@ pub fn getValkeyDefaultClient(globalThis: *jsc.JSGlobalObject, _: *jsc.JSObject)
const as_js = valkey.toJS(globalThis);
valkey.this_value = jsc.JSRef.initWeak(as_js);
valkey._subscription_ctx = SubscriptionCtx.init(valkey) catch |err| {
if (err != error.JSError) {
_ = globalThis.throwError(err, "Failed to create Redis client") catch {};
return .zero;
}
return .zero;
};
valkey._subscription_ctx = SubscriptionCtx.init(valkey);
return as_js;
}

View File

@@ -246,16 +246,15 @@ pub fn applyStaticRoute(server: AnyServer, comptime ssl: bool, app: *uws.NewApp(
pub fn deinit(this: *ServerConfig) void {
this.address.deinit(bun.default_allocator);
bun.default_allocator.free(this.base_uri);
this.base_uri = "";
this.base_url = .{};
for (this.negative_routes.items) |route| {
bun.default_allocator.free(route);
}
this.negative_routes.clearAndFree();
if (this.base_url.href.len > 0) {
bun.default_allocator.free(this.base_url.href);
this.base_url = URL{};
}
if (this.ssl_config) |*ssl_config| {
ssl_config.deinit();
this.ssl_config = null;

View File

@@ -3408,9 +3408,7 @@ static JSC::JSPromise* handleResponseOnStreamingAction(JSGlobalObject* lexicalGl
// getBodyStreamOrBytesForWasmStreaming throws the proper exception. Since this is being
// executed in a .then(...) callback, throwing is perfectly fine.
auto readableStreamMaybe = JSC::JSValue::decode(Zig__GlobalObject__getBodyStreamOrBytesForWasmStreaming(
globalObject, JSC::JSValue::encode(source), compiler.ptr()));
auto readableStreamMaybe = JSC::JSValue::decode(Zig__GlobalObject__getBodyStreamOrBytesForWasmStreaming(globalObject, JSC::JSValue::encode(source), compiler.ptr()));
RETURN_IF_EXCEPTION(scope, nullptr);
// We were able to get the slice synchronously.

View File

@@ -3268,10 +3268,7 @@ pub fn createWithBytesAndAllocator(
) Blob {
return Blob{
.size = @as(SizeType, @truncate(bytes.len)),
.store = if (bytes.len > 0)
Blob.Store.init(bytes, allocator)
else
null,
.store = if (bytes.len > 0) Blob.Store.init(bytes, allocator) else null,
.content_type = if (was_string) MimeType.text.value else "",
.globalThis = globalThis,
};
@@ -3405,6 +3402,7 @@ pub fn deinit(this: *Blob) void {
this.name.deref();
this.name = .dead;
if (this.content_type_allocated) bun.default_allocator.free(this.content_type);
if (this.store) |store| store.deref();
if (this.isHeapAllocated()) {
bun.destroy(this);

View File

@@ -778,7 +778,7 @@ pub fn NewSource(
jsc.markBinding(@src());
this.this_jsvalue = callFrame.this();
var list = this.drain();
defer list.deinit(bun.default_allocator);
// defer list.deinit(bun.default_allocator);
if (list.len > 0) {
return jsc.ArrayBuffer.fromBytes(list.slice(), .Uint8Array).toJS(globalThis);
}

View File

@@ -1174,13 +1174,7 @@ pub fn NewWebSocketClient(comptime ssl: bool) type {
}
}
if (!Socket.adoptPtr(
tcp,
ctx,
WebSocket,
"tcp",
ws,
)) {
if (!Socket.adoptPtr(tcp, ctx, WebSocket, "tcp", ws)) {
ws.deref();
return null;
}

View File

@@ -7,7 +7,7 @@ pub const SubscriptionCtx = struct {
const ParentJS = JSValkeyClient.js;
pub fn init(valkey_parent: *JSValkeyClient) bun.JSError!Self {
pub fn init(valkey_parent: *JSValkeyClient) Self {
const callback_map = jsc.JSMap.create(valkey_parent.globalObject);
const parent_this = valkey_parent.this_value.tryGet() orelse unreachable;
@@ -388,7 +388,7 @@ pub const JSValkeyClient = struct {
new_client.this_value = jsc.JSRef.initWeak(js_this);
// Need to associate the subscription context, after the JS ref has been populated.
new_client._subscription_ctx = try SubscriptionCtx.init(new_client);
new_client._subscription_ctx = SubscriptionCtx.init(new_client);
return new_client;
}

View File

@@ -1264,7 +1264,7 @@ pub fn duplicate(
const new_client_js = new_client.toJS(globalObject);
new_client.this_value = jsc.JSRef.initWeak(new_client_js);
new_client._subscription_ctx = try SubscriptionCtx.init(new_client);
new_client._subscription_ctx = SubscriptionCtx.init(new_client);
// If the original client is already connected and not manually closed, start connecting the new client.
if (this.client.status == .connected and !this.client.flags.is_manually_closed) {
// Use strong reference during connection to prevent premature GC

View File

@@ -199,3 +199,8 @@ leak:interchange.json.parsePackageJSONUTF8
leak:bundler.
leak:http.cloneMetadata
leak:bun.js.rare_data.AWSSignatureCache.set
leak:shell.
leak:bun.js.webcore.blob.Store.init
leak:bun.js.webcore.ByteBlobLoader.drain
leak:bun.js.node.path.dirnamePosixJS_T__anon
leak:bun.js.test.bun_test.BunTest.ref