mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 11:12:17 +03:00
fix(compression): remove duplicate Antigravity project helper
The release branch already includes the generic project-aware connection selection helper. Keep that implementation and remove the duplicate introduced while cherry-picking #9707. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
This commit is contained in:
committed by
diegosouzapw
parent
828a38f126
commit
994e4b354b
@@ -14,25 +14,6 @@
|
||||
|
||||
import { updateProviderConnection } from "@/lib/db/providers";
|
||||
|
||||
/**
|
||||
* Keep only Antigravity connections that already have a stored projectId when
|
||||
* building the reset-aware pool (#8894). A connection without a projectId cannot
|
||||
* be quota-scored, so leaving it in the pool only produces unrankable candidates.
|
||||
*/
|
||||
export function preferAntigravityConnectionsWithStoredProject(
|
||||
connections: Array<Record<string, unknown>>
|
||||
): Array<Record<string, unknown>> {
|
||||
return connections.filter((connection) => {
|
||||
const direct = connection.projectId;
|
||||
const psd = connection.providerSpecificData as Record<string, unknown> | undefined;
|
||||
const psdProjectId = psd?.projectId;
|
||||
return (
|
||||
(typeof direct === "string" && direct.trim().length > 0) ||
|
||||
(typeof psdProjectId === "string" && psdProjectId.trim().length > 0)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Write `discoveredProjectId` onto both the `projectId` column and
|
||||
* `providerSpecificData.projectId` for `connectionId`, preserving any other
|
||||
|
||||
Reference in New Issue
Block a user