Skip to content

Fix broken merge state: restore app.js functions, pkg import, and refactor collectRelationEdges#34

Merged
Johnaverse merged 2 commits intofix/sonarqube-code-quality-v1.1.0from
copilot/sub-pr-31-another-one
Mar 7, 2026
Merged

Fix broken merge state: restore app.js functions, pkg import, and refactor collectRelationEdges#34
Johnaverse merged 2 commits intofix/sonarqube-code-quality-v1.1.0from
copilot/sub-pr-31-another-one

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

A bad merge left several critical runtime breakages across index.js, public/app.js, and dataService.js — causing GET / to 500, the graph UI to fail loading data, and the details panel to render incomplete.

index.js

  • Added missing import pkg from './package.json' with { type: 'json' }pkg.version was referenced but never imported, causing every GET / request to throw a ReferenceError

public/app.js

  • fetchExportData: Fixed duplicate let res declaration, improperly nested try, and missing res.json() return (was returning undefined relations)
  • buildRelationsMap: Restored function that was lost in the merge but still called by fetchData
  • showNodeDetails: Restored full function body — was truncated after the status badge, omitting currency, parent/child chains, RPCs, explorers, website rendering, and panel reveal
  • showWebsite: Replaced broken implementation (unclosed try, out-of-scope node/panel variables) with correct URL protocol validation — only http:/https: schemes render as links; others fall back to plain text:
const protocol = url.protocol.toLowerCase();
if (protocol === 'http:' || protocol === 'https:') {
    // render anchor
} else {
    webElem.textContent = data.infoURL; // unsafe scheme: plain text
}

dataService.js

  • collectRelationEdges: Added missing edge deduplication logic; updated traverseRelations to delegate to this helper using a Set for O(1) key lookup instead of the previous O(n²) Array.some() scan per edge

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…collectRelationEdges

Co-authored-by: Johnaverse <110527930+Johnaverse@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix SonarQube issues and bump version to 1.1.0 Fix broken merge state: restore app.js functions, pkg import, and refactor collectRelationEdges Mar 7, 2026
@Johnaverse Johnaverse marked this pull request as ready for review March 7, 2026 02:41
@Johnaverse Johnaverse merged commit 771b154 into fix/sonarqube-code-quality-v1.1.0 Mar 7, 2026
@Johnaverse Johnaverse deleted the copilot/sub-pr-31-another-one branch March 7, 2026 02:44
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.

2 participants