Feature/userinfo - #273
Conversation
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
==========================================
- Coverage 41.74% 38.27% -3.48%
==========================================
Files 992 1183 +191
Lines 49697 56838 +7141
Branches 5854 6149 +295
==========================================
+ Hits 20748 21753 +1005
- Misses 28038 34105 +6067
- Partials 911 980 +69
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
This comment was marked as resolved.
This comment was marked as resolved.
…modal) and responds to code-quality bot userinfo recommendations
22567dc to
694ecd4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
… IDisposable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
| foreach (var middleInitial in middleParts | ||
| .Where(middlePart => middlePart.Length > 0) | ||
| .Select(middlePart => middlePart[0])) | ||
| { | ||
| var variation = $"{name} {middleInitial}"; | ||
| if (!nameVariations.Contains(variation)) | ||
| { | ||
| nameVariations.Add(variation); | ||
| } | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 218 out of 220 changed files in this pull request and generated no new comments.
Suppressed comments (3)
web/Areas/Directory/Controllers/DirectoryController.cs:145
- This refactor dropped the length guard that the original inline code (and the comment just below in
AddVmacsContactInfoAsync) relied on.Nextel,LDPager, andUnitarestring[]?, and empty XML element lists deserialize as empty (length‑0) arrays rather than null. With only a!= nullcheck, indexing[0]on an empty array will throwIndexOutOfRangeException. Restore the{ Length: > 0 }guard (consistent withUserInfoService.cswhich uses?.Length > 0).
if (vm.item.Nextel != null) result.Nextel = vm.item.Nextel[0];
if (vm.item.LDPager != null) result.LDPager = vm.item.LDPager[0];
if (vm.item.Unit != null) result.Department = vm.item.Unit[0];
web/Areas/Directory/Models/IndividualSearchResultWithIDs.cs:49
LdapUserContact.PostalAddressis declared= null!and is only assigned when the LDAP entry contains apostalAddressattribute, so it can be null at runtime. Removing the null guard here meansPostalAddress.Replace(...)can throw aNullReferenceException. Note the baseIndividualSearchResultconstructor already uses the null-safe form (?.Replace(...) ?? ""); this override should match it.
PostalAddress = ldapUserContact.PostalAddress.Replace("$", '\n'.ToString());
web/Classes/Utilities/LdapService.cs:123
- The param documentation is inaccurate: this method looks up by MothraID (the filter uses
ucdpersonuuid, which maps toLdapUserContact.MothraId), not by iamID. Describing the parameter as "iamID" could lead callers to pass the wrong identifier.
| @@ -113,6 +136,24 @@ public IActionResult DirectoryResult(string mothraID) | |||
| return View("~/Areas/Directory/Views/UserInfo.cshtml"); | |||
There was a problem hiding this comment.
@JasonRobertFrancis This returns UserInfo.cshtml with no model, but the view is @model UserInfoResult and dereferences Model.DisplayFullName on line 3. Every request to /Directory/userInfo/{mothraID} is a 500. UserInfoController supersedes it and Card.cshtml now links to /UserInfo/{mothraId}, so this should be deleted.
| Console.WriteLine($"[INSTINCT SERVICE] mothraId: '{mothraId}', iamId: '{iamId}', result.MothraId: '{result.MothraId}'"); | ||
| var individual = await _aaudContext.AaudUsers.FirstOrDefaultAsync(u => (u.MothraId == result.MothraId)); | ||
| Console.WriteLine($"[INSTINCT SERVICE] individual is null: {individual == null}"); | ||
| if (individual != null) | ||
| { | ||
| Console.WriteLine($"[INSTINCT SERVICE] individual: '{individual.DisplayFullName}', LastName: '{individual.LastName}', FirstName: '{individual.FirstName}'"); |
There was a problem hiding this comment.
@JasonRobertFrancis These run on every user info page load and write mothraId, iamId, and the person's full name to stdout. Looks like leftover debugging from the Instinct work. There are 30 Console.WriteLine calls in this file and no ILogger at all. Please drop the debug ones and move the rest to an injected logger, running route input through LogSanitizer first.
| foreach (var middleInitial in middleParts | ||
| .Where(middlePart => middlePart.Length > 0) | ||
| .Select(middlePart => middlePart[0])) | ||
| { | ||
| var variation = $"{name} {middleInitial}"; | ||
| if (!nameVariations.Contains(variation)) | ||
| { | ||
| nameVariations.Add(variation); | ||
| } | ||
| } |
No description provided.