Skip to content

Keep Scoop source placeholders valid across source reloads - #5596

Open
HawkForge wants to merge 1 commit into
Devolutions:mainfrom
HawkForge:fix/scoop-placeholder-source-url
Open

HawkForge wants to merge 1 commit into
Devolutions:mainfrom
HawkForge:fix/scoop-placeholder-source-url

Conversation

@HawkForge

Copy link
Copy Markdown
Contributor
  • I have read the contributing guidelines, and I agree with the Code of Conduct.
  • Have you checked that there aren't other open pull requests for the same changes?
  • Have you tested that the committed code can be executed without errors?
  • Have you confirmed that this issue is caused by UniGetUI itself, and not by the package manager or the package involved?
    If the same issue can be reproduced outside UniGetUI with the relevant package manager or with the package itself, please report it there first. UniGetUI should only be used to track issues that are specific to UniGetUI's behavior or integration.

Thanks to Reece (@Reeceeboii) for the report.

When a Scoop package is created before the bucket list is known, SourceFactory.GetSourceOrDefault hands it a placeholder ManagerSource with the URL https://devolutions.net/unigetui. Loading the sources (BaseSourceHelper._getSources) then calls Factory.Reset() and AddSource for each real bucket. AddSource only fixes the URL of a placeholder that is still in the factory, and after Reset() it is not, so packages created earlier keep the placeholder URL for good. Packages listed after the sources load are fine, which is why it only happens sometimes.

The factory now remembers the placeholders it hands out, across Reset(). AddSource also gives the remembered placeholder the real URL, and GetSourceOrDefault reuses the same placeholder instance after a Reset() instead of creating a second one. Sources that were never placeholders are unchanged.

Added SourceFactoryTests (not gated on Windows, unlike ScoopManagerTests): one checks that a placeholder handed out before Reset() gets the real URL from AddSource, the other that GetSourceOrDefault returns the same placeholder after Reset(). Both fail without the fix.

Testing (net10.0, Linux):

  • dotnet test ... --filter FullyQualifiedName~SourceFactoryTests: 2 passed; 2 failed without the fix.
  • Full UniGetUI.PackageEngine.Tests: the same 31 Windows/environment-specific failures as on main, nothing new.
  • dotnet format whitespace src --folder --verify-no-changes: clean. dotnet format style on the Avalonia slnx for the changed files: clean. The Windows slnx was not run.

I reproduced this at the SourceFactory level, not in the app itself on Windows.

Closes #4835

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Scoop manifest URLs showing as devolutions.net instead of github.com

1 participant