Skip to content

Conversation

@Sergio0694
Copy link
Member

Follow up for #3424

PR Type

What kind of change does this PR introduce?

  • Bugfix-ish

Overview

The .NET 5 target currently uses the .NET Standard 2.0 code path within WeakReferenceMessenger.
Not technically a bug since the implementation does work, but it can be greatly simplified like on .NET Standard 2.1.
This should also make the code add slightly less GC pressure over time due to less additional data structures in use.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

@Sergio0694 Sergio0694 added improvements ✨ mvvm-toolkit 🧰 Issues/PRs for the Microsoft.Toolkit.Mvvm package labels Apr 9, 2021
@Sergio0694 Sergio0694 added this to the 7.1 milestone Apr 9, 2021
@ghost
Copy link

ghost commented Apr 9, 2021

Thanks Sergio0694 for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from Kyaa-dost, Rosuavio, azchohfi and michael-hawker April 9, 2021 17:06
@Sergio0694
Copy link
Member Author

Sergio0694 commented Apr 9, 2021

Hey @azchohfi - just FYI in case you haven't noticed it, I think the CI is currently broken for this repo 🤔
Both this and other PRs (eg. #3929 and #3906) are failing with the same CI error, though they build fine locally:

Unhandled Exception: System.InvalidOperationException: Sequence contains more than one element
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   at InheritDocLib.XElementX.CopyFrom(XElement target, XElement source, String[] pathParts)
   at InheritDocLib.InheritDocUtil.MergeMemberElements(ICollection`1 assemblyDocuments, ICollection`1 allAssemblyDocuments, IDictionary`2 typeDocByName, String typeName, TypeDoc typeDoc, String cref, MemberElementName memberElementName, String path, Action`2 logger)
   at InheritDocLib.InheritDocUtil.ReplaceInheritDocs(ICollection`1 assemblyDocuments, ICollection`1 allAssemblyDocuments, IDictionary`2 typeDocByName, ICollection`1 sortedTypeNames, Action`2 logger)
   at InheritDocLib.InheritDocUtil.Run(String basePath, String xmlDocFileNamePatterns, String globalSourceXmlFiles, String excludeTypes, Boolean overwriteExisting, Action`2 logger)
   at InheritDoc.Program.<>c.<Main>b__1_1(Options options)
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at InheritDoc.Program.Main(String[] args)
An error occurred when executing task 'InheritDoc'.

Not sure it's related to some doc issue in the repo since the main branch is building just fine from what I can see.
Any ideas? 😄

EDIT: I'm terribly sorry to the other Alex for the accidental ping, I clicked on the wrong autocomplete item 😅

@azchohfi
Copy link
Contributor

azchohfi commented Apr 9, 2021

cherry pick this:
fd9ce62

@Sergio0694 Sergio0694 force-pushed the bugfix/weak-messenger-net5 branch from a740074 to c0ec8d9 Compare April 9, 2021 20:17
@Sergio0694
Copy link
Member Author

Worked like a charm, thanks @azchohfi! You're the ultimate git/CI wizard 🙌🧙‍♂️✨

@Sergio0694 Sergio0694 force-pushed the bugfix/weak-messenger-net5 branch 2 times, most recently from 4b17b0d to 5dc179f Compare April 14, 2021 17:10
@ghost
Copy link

ghost commented Apr 15, 2021

Hello @RosarioPulella!

Because this pull request has the auto merge :zap: label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@Sergio0694 Sergio0694 force-pushed the bugfix/weak-messenger-net5 branch from 834ee28 to fe7a98b Compare April 16, 2021 11:50
@ghost ghost merged commit d3426fa into CommunityToolkit:master Apr 16, 2021
@Sergio0694 Sergio0694 deleted the bugfix/weak-messenger-net5 branch April 16, 2021 12:54
@michael-hawker
Copy link
Member

FYI @shweaver-MSFT, you were also hitting the InheritDoc issue.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto merge ⚡ hotfix 🌶 improvements ✨ mvvm-toolkit 🧰 Issues/PRs for the Microsoft.Toolkit.Mvvm package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants