-
Notifications
You must be signed in to change notification settings - Fork 18
Retrieved active chunk in the same backend call #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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) { |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
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 + '' }
| if (agent.chunks.length > 0) { | |
| if (Array.isArray(agent.chunks) && agent.chunks.length > 0) { |
| const agentSpeed: number = this.getChunkDataValue(agent, 'speed'); | ||
| if (agentSpeed) { | ||
| return this.sanitize(convertCrackingSpeed(agentSpeed)); | ||
| const chunk = agent.chunks[0]; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
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;
| const chunk = agent.chunks[0]; | |
| const chunk = agent.chunks && Array.isArray(agent.chunks) && agent.chunks.length > 0 ? agent.chunks[0] : undefined; |
| export: async (agent: JAgent) => this.getChunkDataValue(agent, 'speed') + '' | ||
| export: async (agent: JAgent) => { | ||
| if (agent.chunks.length > 0) { | ||
| return agent.chunks[0].speed + '' |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
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.
| return agent.chunks[0].speed + '' | |
| return agent.chunks[0].speed + ''; |
hashtopolis/server#1736 should be merged first