Skip to content
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

FindRepository Fix #112

Closed

Conversation

ennerperez
Copy link
Contributor

The problem I found in #90 was essentially a difference between "Repositories" and "RepositoryNodes" in some scenarios "Repositories" get an empty list when in other hand "RepositoryNodes" get elements inside, that make visible all repos in the UI but not accessible because it's not present in "Repositories"

image

This workaround basically copies existing repos from "RepositoryNodes" into Repositories when the user tries to open it, and for some reason this is not in the "Repository" node from the preferences.

I rather to check this Json file, because as far I saw this, looks like there is no need to have two "Repositories" nodes inside same Json file, but for now this is my workaround.

@love-linger
Copy link
Collaborator

I've pushed a commit d87716d to solve this problem. This issue appear when Directory.Exists(repo.FullPath) returns false for some unknown reason on app startup.

@love-linger
Copy link
Collaborator

Property Repositories stores all the managed repositories. Before commit d87716d, it will try to remove those failed with checking Directory.Exists(repo.FullPath).

Property RepositoryNodes stores the structure (as a tree) that you group your repositories. It used by the welcome page. For example, here is mine:

image

@love-linger
Copy link
Collaborator

And one more thing, according to the manual of Native AOT deployment overview, it's not recommanded to use System.Linq in this app (and it will introduce a compile warning).

image

@ennerperez
Copy link
Contributor Author

image

Please refer to: #114

I'll be removing the reference System.Linq according to the AOT limitations

@love-linger
Copy link
Collaborator

love-linger commented May 7, 2024

Make sure that your device is properly mounted to the path /run/media/xxxx when this app starts. There is only one line code can cause this problem - _instance.Repositories.RemoveAll(x => !Directory.Exists(x.FullPath));

@ennerperez
Copy link
Contributor Author

ennerperez commented May 7, 2024

Yes I'm 100% sure of this, it's my Main work disk, also this happens to me in macOS the Json get malformed sometimes.

The problem it's not deleting the node from Json file, the problem is having duplicates nodes to save the same information for some reason store data in Repository nodes but not in Repository, you can restore this line cuz is fine, it's not the real problem.

@ennerperez
Copy link
Contributor Author

ennerperez commented May 7, 2024

Please take a look at PR 114.

Also take a look to the FS pictures I attached for this issue.

@love-linger
Copy link
Collaborator

I've test this pr by gh pr checkout 112 and the other one by gh pr checkout 114. I know exactly what you have changed. As I said before, I do NOT want to merge Repository into RepositoryNode, because they are different things that store different informations.

@love-linger
Copy link
Collaborator

And duplicated node should also work if repository has not been removed from preference. We find the repository by the node's id.

For example, I created two node that both points to the same repository manually. Both work well until the repository has been remove from property Repositories.

image

I do NOT think duplicated nodes will be the reason of issue #90.

@love-linger love-linger self-assigned this May 14, 2024
@love-linger love-linger added the invalid This doesn't seem right label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants