Skip to content

Commit 2ab5f79

Browse files
committed
fix: correct TryGetCachedResult doc and nullability
- Remove incorrect "Safe to call from any thread" claim; method reads EditorPrefs which requires the Unity main thread - Add nullable return type annotation to match the null-on-cache-miss behavior
1 parent 4f52b86 commit 2ab5f79

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

MCPForUnity/Editor/Services/IPackageUpdateService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public interface IPackageUpdateService
1414

1515
/// <summary>
1616
/// Returns a cached update result if one exists for today, or null if a network fetch is needed.
17-
/// Safe to call from any thread context but designed for main-thread use (reads EditorPrefs).
17+
/// Main-thread only (reads EditorPrefs).
1818
/// </summary>
19-
UpdateCheckResult TryGetCachedResult(string currentVersion);
19+
UpdateCheckResult? TryGetCachedResult(string currentVersion);
2020

2121
/// <summary>
2222
/// Performs only the network fetch and version comparison (no EditorPrefs access).

MCPForUnity/Editor/Services/PackageUpdateService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public UpdateCheckResult CheckForUpdate(string currentVersion)
8383
}
8484

8585
/// <inheritdoc/>
86-
public UpdateCheckResult TryGetCachedResult(string currentVersion)
86+
public UpdateCheckResult? TryGetCachedResult(string currentVersion)
8787
{
8888
bool isGitInstallation = IsGitInstallation();
8989
string gitBranch = isGitInstallation ? GetGitUpdateBranch(currentVersion) : "main";

0 commit comments

Comments
 (0)