Skip to content

Conversation

@jessevz
Copy link
Contributor

@jessevz jessevz commented Nov 10, 2025

hashtopolis/server#1736 should be merged first

Copy link
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 refactors the agents datasource by removing client-side chunk data loading logic and relies on server-side chunk relationships instead. The key changes include removing the loadChunkData and setChunkParams methods from the datasource, and updating the agents table component to access chunk data directly from the agent.chunks property.

Key Changes

  • Removed client-side chunk loading and processing logic from AgentsDataSource
  • Updated agents table component to access chunk speed directly from agent.chunks[0].speed
  • Minor code style fix in tasks table component (added missing semicolon)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/app/core/_datasources/agents.datasource.ts Removed loadChunkData, setChunkParams methods and their invocations, simplifying the datasource by removing chunk data loading logic
src/app/core/_components/tables/agents-table/agents-table.component.ts Updated to access chunk data via agent.chunks[0] instead of agent.chunkData for speed display and export
src/app/core/_components/tables/tasks-table/tasks-table.component.ts Code style fix: added missing semicolon

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

isSortable: false,
export: async (agent: JAgent) => this.getChunkDataValue(agent, 'speed') + ''
export: async (agent: JAgent) => {
if (agent.chunks.length > 0) {
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Potential runtime error: agent.chunks may be undefined or not an array. Add a null check before accessing agent.chunks.length and agent.chunks[0]. Consider: if (agent.chunks && agent.chunks.length > 0) { return agent.chunks[0].speed + '' }

Suggested change
if (agent.chunks.length > 0) {
if (Array.isArray(agent.chunks) && agent.chunks.length > 0) {

Copilot uses AI. Check for mistakes.
const agentSpeed: number = this.getChunkDataValue(agent, 'speed');
if (agentSpeed) {
return this.sanitize(convertCrackingSpeed(agentSpeed));
const chunk = agent.chunks[0];
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Potential runtime error: agent.chunks may be undefined or not an array. The check on line 264 should verify both that agent.chunks exists and has elements before accessing agent.chunks[0]. Consider: const chunk = agent.chunks && agent.chunks.length > 0 ? agent.chunks[0] : undefined;

Suggested change
const chunk = agent.chunks[0];
const chunk = agent.chunks && Array.isArray(agent.chunks) && agent.chunks.length > 0 ? agent.chunks[0] : undefined;

Copilot uses AI. Check for mistakes.
export: async (agent: JAgent) => this.getChunkDataValue(agent, 'speed') + ''
export: async (agent: JAgent) => {
if (agent.chunks.length > 0) {
return agent.chunks[0].speed + ''
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing semicolon after the return statement on line 159. Add a semicolon for consistency with the rest of the codebase.

Suggested change
return agent.chunks[0].speed + ''
return agent.chunks[0].speed + '';

Copilot uses AI. Check for mistakes.
@cv5ch cv5ch merged commit 8da5d7e into master Nov 14, 2025
4 checks passed
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