Skip to content

Use Gzipped version of navlink#20

Merged
Egezenn merged 1 commit into
Silkroad-Developer-Community:mainfrom
Egezenn:gzip-navlink
Jun 22, 2026
Merged

Use Gzipped version of navlink#20
Egezenn merged 1 commit into
Silkroad-Developer-Community:mainfrom
Egezenn:gzip-navlink

Conversation

@Egezenn

@Egezenn Egezenn commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Release Notes

  • Chores
    • Streamlined application build process with automatic navigation data download during initialization.
    • Optimized data transfer efficiency through compressed downloads.

…d-NavLink@4ace5ed)

- Move the fetching from buildscript to msbuild & download only once
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Navigation linkage data delivery switches from a raw JSON URL to a gzip-compressed GitHub release artifact. NavigationManager is updated to fetch and decompress the .gz stream at runtime. A new MSBuild post-build target in OasisBot.csproj handles the initial file download, replacing the equivalent block removed from scripts/build.ps1.

Changes

Gzip release artifact migration

Layer / File(s) Summary
NavigationManager URL and gzip decompression
Botbases/RSBot.Training/Bot/NavigationManager.cs
LinkageUrl updated to the .gz release artifact path. FetchRemoteLinkageData() replaced GetStringAsync with GetAsync + GZipStream decompression. Warning message capitalization in LoadLinkageData() adjusted.
MSBuild post-build target and build.ps1 removal
Application/OasisBot/OasisBot.csproj, scripts/build.ps1
New DownloadNavigationLinkage MSBuild target added to download and decompress navigation_linkage.json.gz after build when the file is absent via a PowerShell Exec command. The equivalent download/parse/move block removed from build.ps1.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop! The JSON came zipped today,
A .gz bundle bounced down the relay,
MSBuild unwraps it fresh from the net,
The build script forgot what it used to fret,
Compressed and clean — the fastest bouquet! 🗜️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Use Gzipped version of navlink' directly and accurately describes the main change: switching to a gzipped version of the navigation linkage file across three key components.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Egezenn added a commit to Egezenn/OasisBot that referenced this pull request Jun 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Botbases/RSBot.Training/Bot/NavigationManager.cs (1)

119-129: ⚡ Quick win

Consider adding a timeout for network resilience.

The HttpClient has no timeout configured, so a slow or unresponsive server could cause this operation to hang indefinitely. Since this is invoked from the UI (the "Update NavLink" button), a hung request would leave users waiting without feedback.

♻️ Suggested fix
 Log.Notify("Fetching navigation linkage data from GitHub...");
-using var client = new HttpClient();
+using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
 using var response = await client.GetAsync(LinkageUrl);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Botbases/RSBot.Training/Bot/NavigationManager.cs` around lines 119 - 129, The
HttpClient instance has no timeout configured, which can cause the operation to
hang indefinitely on unresponsive servers and freeze the UI. Set the Timeout
property on the client instance (created with new HttpClient()) to a reasonable
TimeSpan value immediately after instantiation but before the GetAsync call to
ensure the network request completes or fails within an acceptable timeframe.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Botbases/RSBot.Training/Bot/NavigationManager.cs`:
- Around line 119-129: The HttpClient instance has no timeout configured, which
can cause the operation to hang indefinitely on unresponsive servers and freeze
the UI. Set the Timeout property on the client instance (created with new
HttpClient()) to a reasonable TimeSpan value immediately after instantiation but
before the GetAsync call to ensure the network request completes or fails within
an acceptable timeframe.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5dc98818-7660-49d7-997e-e29b0a4c6c7b

📥 Commits

Reviewing files that changed from the base of the PR and between 796177c and fa0549c.

📒 Files selected for processing (3)
  • Application/OasisBot/OasisBot.csproj
  • Botbases/RSBot.Training/Bot/NavigationManager.cs
  • scripts/build.ps1
💤 Files with no reviewable changes (1)
  • scripts/build.ps1

@Egezenn Egezenn merged commit a113e15 into Silkroad-Developer-Community:main Jun 22, 2026
2 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.

1 participant