0x5bfa / FluentHub

A stylish yet powerful GitHub client for Windows
MIT License
1.06k stars 51 forks source link

Bug: Opening repos with a large amount of files and dirs causes the app to crash #260

Open arihant2math opened 1 year ago

arihant2math commented 1 year ago

⏱️ Before you start...

🪟 What version of Windows is this issue present?

Windows 11 Beta

🔢 What version/architecture of FluentHub are you on?

0acd4f702e4e75b237fbb0201d786c8d313add3c x64

📄 Description

Opening repos sometimes causes the app to crash, its the same repos and it always happens for those repos.

🪜 Steps To Reproduce

Open an affected repo.

🤔 Expected behavior

It should not crash.

📸 Assets

Stacktrace:

   at x => new Repository() {HomepageUrl = x.HomepageUrl, ForkingAllowed = x.ForkingAllowed, HasIssuesEnabled = x.HasIssuesEnabled, HasProjectsEnabled = x.HasProjectsEnabled, IsArchived = x.IsArchived, IsPrivate = x.IsPrivate, IsTemplate = x.IsTemplate, ViewerSubscription = Convert(Convert(x.ViewerSubscription, SubscriptionState), Nullable`1), Name = x.Name, Description = x.Description, StargazerCount = x.StargazerCount, ForkCount = x.ForkCount, IsFork = x.IsFork, IsInOrganization = x.IsInOrganization, ViewerHasStarred = x.ViewerHasStarred, UpdatedAt = x.UpdatedAt, LicenseInfo = x.LicenseInfo.Select(licenseInfo => new License() {Name = licenseInfo.Name}).SingleOrDefault(), DefaultBranchRef = x.DefaultBranchRef.Select(defaultbranchref => new Ref() {Name = defaultbranchref.Name}).SingleOrDefault(), Watchers = x.Watchers(null, null, null, null).Select(watchers => new UserConnection() {TotalCount = watchers.TotalCount}).Single(), Releases = x.Releases(null, null, null, null, null).Select(releases => new ReleaseConnection() {TotalCount = releases.TotalCount}).Single(), Issues = x.Issues(null, null, null, null, null, null, null, Convert(value(FluentHub.Octokit.Queries.Repositories.RepositoryQueries+<>c__DisplayClass1_0).issueState, Nullable`1)).Select(issues => new IssueConnection() {TotalCount = issues.TotalCount}).Single(), PullRequests = x.PullRequests(null, null, null, null, null, null, null, null, Convert(value(FluentHub.Octokit.Queries.Repositories.RepositoryQueries+<>c__DisplayClass1_0).pullRequestState, Nullable`1)).Select(issues => new PullRequestConnection() {TotalCount = issues.TotalCount}).Single(), Owner = x.Owner.Select(owner => new RepositoryOwner() {AvatarUrl = owner.AvatarUrl(Convert(Convert(100, Arg`1), Nullable`1)), Id = owner.Id, Login = owner.Login}).Single(), LatestRelease = x.Releases(null, null, Convert(Convert(1, Arg`1), Nullable`1), null, null).Nodes.Select(release => new Release() {DescriptionHTML = release.DescriptionHTML, IsDraft = release.IsDraft, IsLatest = release.IsLatest, IsPrerelease = release.IsPrerelease, Name = release.Name, PublishedAt = release.PublishedAt, Author = release.Author.Select(author => new User() {Login = author.Login, AvatarUrl = author.AvatarUrl(Convert(Convert(100, Arg`1), Nullable`1))}).Single()}).ToList().FirstOrDefault()}(Closure , JToken )
   at Octokit.GraphQL.Core.Builders.Rewritten.Value.Select[TResult](JToken source, Func`2 selector)
   at Octokit.GraphQL.Core.Deserializers.ResponseDeserializer.Deserialize[TResult](Func`2 deserialize, JObject data)
   at Octokit.GraphQL.Core.Deserializers.ResponseDeserializer.Deserialize[TResult](Func`2 deserialize, String data)
   at Octokit.GraphQL.Core.SimpleQuery`1.Runner.RunPage(CancellationToken cancellationToken)
   at Octokit.GraphQL.ConnectionExtensions.Run[T](IConnection connection, ICompiledQuery`1 query, Dictionary`2 variables, CancellationToken cancellationToken)
   at FluentHub.Octokit.Queries.Repositories.RepositoryQueries.GetDetailsAsync(String owner, String name)
   at FluentHub.Uwp.ViewModels.Repositories.Code.Layouts.DetailsLayoutViewModel.LoadRepositoryAsync(String owner, String name)
   at FluentHub.Uwp.ViewModels.Repositories.Code.Layouts.DetailsLayoutViewModel.LoadDetailsViewPageAsync()
arihant2math commented 1 year ago

Found the root cause, submitting a pr soon.

arihant2math commented 1 year ago

255 has reemerged for some reason ...

arihant2math commented 1 year ago

I am unable to fix the issue, it seems to originate from the async await methods not fully completing.

arihant2math commented 1 year ago

I noticed that it only happened to repos with a large amount of files and dirs in the root dir. Definitely an async issue then.

0x5bfa commented 1 year ago

What's the exceptiontitle?