Skip to content

fix(core): fix base query to return asset data when httpx failed#281

Merged
l1ttps merged 3 commits intomainfrom
fix/asset-query
Feb 24, 2026
Merged

fix(core): fix base query to return asset data when httpx failed#281
l1ttps merged 3 commits intomainfrom
fix/asset-query

Conversation

@mizhm
Copy link
Copy Markdown
Contributor

@mizhm mizhm commented Feb 23, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 23, 2026 14:34
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mizhm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where certain assets were not being displayed or retrieved due to overly strict filtering based on status codes. The changes relax these filtering conditions in the backend and ensure that the frontend UI for asset details dynamically adapts to the presence of network information, preventing empty sections. Additionally, dependency metadata has been updated for improved package management.

Highlights

  • Asset Query Logic Adjustment: Modified the asset query logic in the backend to include assets with NULL or 0 status codes, which were previously excluded. This ensures a more comprehensive retrieval of asset data.
  • Frontend Network Section Display: Implemented conditional rendering for the 'Network' section in the asset detail view, ensuring it only appears when relevant TLS data is available. This prevents the display of empty sections.
  • Dependency Metadata Updates: Updated package-lock.json to adjust peer dependency flags for numerous packages, primarily adding peer: true to many entries and removing it from a few others, reflecting changes in dependency resolution metadata.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • console/src/pages/assets/components/asset-detail.tsx
    • Wrapped the 'Network' section with a conditional tls check to prevent rendering when no TLS data is present.
  • core-api/src/modules/assets/assets.service.ts
    • Imported Brackets from typeorm for advanced query building.
    • Modified the main asset query to include assets where statusCodeAssets.statusCode is NULL or not equal to 0.
    • Removed the explicit statusCodeAssets.statusCode != 0 filter from the single asset retrieval query, allowing assets with a status code of 0 to be fetched by ID.
  • package-lock.json
    • Added 'peer: true' flag to numerous package entries, including @babel/parser, @better-auth/utils, @better-fetch/fetch, @biomejs/wasm-nodejs, @codemirror/view, @grpc/grpc-js, @modelcontextprotocol/sdk, @nestjs/common, @nestjs/core, @nestjs/microservices, @nestjs/platform-express, @nestjs/typeorm, @swc/core, @swc/jest, @tanstack/react-query, @types/estree, @types/express, @types/node, @types/react, @types/react-dom, @typescript-eslint/eslint-plugin, acorn, ajv, axios, bare-events, @better-auth/core, better-call, browserslist, bullmq, chokidar, class-transformer, class-validator, d3-selection, devtools-protocol, eslint, eslint-config-prettier, express, hono, immer, jest, jose, jsep, kysely, mongodb, next, openapi-types, commander, passport, pg, prettier, react, react-dom, react-hook-form, rxjs, json-schema-to-ts, tsconfig-paths, typedoc, typeorm, typescript, vite, zod, and zod-to-json-schema.
    • Removed 'peer: true' flag from buffer-equal-constant-time, ecdsa-sig-formatter, es-module-lexer, jsonwebtoken, jwa, jws, lodash.includes, lodash.isboolean, lodash.isinteger, lodash.isnumber, lodash.isplainobject, lodash.isstring, lodash.once, eslint-scope, eslint-utils, eslint-visitor-keys, and mime-types.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an issue with the asset query by correctly filtering assets based on their status code, ensuring that assets with a NULL status code are included. It also includes a related UI fix in the asset detail view to conditionally render the 'Network' section, preventing an empty section from being displayed when TLS data is not available. My review includes a suggestion to further refine this UI logic to avoid rendering the section if specific network details are missing.

Comment on lines +144 to +165
{tls && (
<section>
<h3 className="font-bold text-indigo-500 flex items-center gap-2 sm:gap-3 mb-3 sm:mb-4">
<Network size={20} className="text-indigo-500" /> Network
</h3>
<div className="grid grid-cols-1 md:grid-cols-2 gap-y-3 sm:gap-y-4 gap-x-6 sm:gap-x-8">
{tls?.host && (
<div>
<span className="block mb-1">Host</span>
<span className="">{tls.host}</span>
</div>
)}
{/* Port from TLS data, but presented in Network section */}
{tls?.port && (
<div>
<span className="block mb-1">Port</span>
<span className="">{tls.port}</span>
</div>
)}
</div>
</section>
)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current check tls && is an improvement, but it might still render an empty "Network" section if the tls object exists but both host and port are missing. To prevent this, it's better to check for the presence of tls.host or tls.port directly.

        {(tls?.host || tls?.port) && (
          <section>
            <h3 className="font-bold text-indigo-500 flex items-center gap-2 sm:gap-3 mb-3 sm:mb-4">
              <Network size={20} className="text-indigo-500" /> Network
            </h3>
            <div className="grid grid-cols-1 md:grid-cols-2 gap-y-3 sm:gap-y-4 gap-x-6 sm:gap-x-8">
              {tls.host && (
                <div>
                  <span className="block mb-1">Host</span>
                  <span className="">{tls.host}</span>
                </div>
              )}
              {/* Port from TLS data, but presented in Network section */}
              {tls.port && (
                <div>
                  <span className="block mb-1">Port</span>
                  <span className="">{tls.port}</span>
                </div>
              )}
            </div>
          </section>
        )}

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts asset querying so assets/services without a populated HTTP status code are no longer filtered out, and updates the asset detail UI to avoid rendering empty network details when TLS data is absent.

Changes:

  • Updates the core assets query to allow NULL status codes while still excluding status code 0.
  • Removes a redundant status-code filter from getAssetById() (now covered by the base query logic).
  • Conditionally renders the “Network” section in the console asset detail only when TLS data exists.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
package-lock.json Lockfile regenerated (large metadata-only churn, including many peer: true flags).
core-api/src/modules/assets/assets.service.ts Changes base query status-code filtering to include NULL and removes redundant per-ID filtering.
console/src/pages/assets/components/asset-detail.tsx Guards “Network” section rendering behind presence of tls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +125 to +131
.andWhere(
new Brackets((qb) => {
qb.where('"statusCodeAssets"."statusCode" IS NULL').orWhere(
'"statusCodeAssets"."statusCode" != 0',
);
}),
);
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new base filter (statusCode IS NULL OR statusCode != 0) means queries that group/filter by status code can now include a NULL statusCode bucket (e.g., getStatusCodeAssets() groups on "statusCodeAssets"."statusCode"). This can surface rows with statusCode: null to the console, and the UI then uses row.statusCode as a filter value, which can result in statusCodes=[null] requests.

Consider keeping this base query change for asset listing, but explicitly exclude NULL status codes in the status-code aggregation endpoint (or map NULL to a well-defined sentinel) so the status-code facet remains valid and clickable.

Copilot uses AI. Check for mistakes.
@l1ttps l1ttps mentioned this pull request Feb 24, 2026
3 tasks
Copy link
Copy Markdown
Member

@l1ttps l1ttps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mizhm for this fix!

The changes look good - relaxing the status code filter to include assets with NULL status codes makes sense since some assets may not have HTTP responses yet. The frontend improvement to conditionally render the Network section also improves UX by avoiding empty sections.

One minor note: the package-lock.json changes are quite extensive (peer dependency flags). In the future, it might be worth separating dependency updates into a dedicated PR for cleaner history, but this doesn't block the merge.

Great work!

@l1ttps l1ttps merged commit bdbc0db into main Feb 24, 2026
9 checks passed
@l1ttps l1ttps deleted the fix/asset-query branch February 24, 2026 03:52
@l1ttps l1ttps changed the title Fix/asset query fix(core): fix base query to return asset data when httpx failed Mar 6, 2026
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.

3 participants