chore(humans): delete a dead repository read, and say why its neighbour stays - #834
Open
hokiepokedad2 wants to merge 1 commit into
Open
chore(humans): delete a dead repository read, and say why its neighbour stays#834hokiepokedad2 wants to merge 1 commit into
hokiepokedad2 wants to merge 1 commit into
Conversation
…ur stays IHumanRepository.GetByIdAsync had no callers. HumanService.GetByIdAsync goes through the proxy, so every controller that reads a human is already on the API; the repository method was left behind by that migration and nothing referenced it, tests included. ExistsAsync is NOT the same case, and the comment now records why so this does not get "cleaned up" later. IHumanService.ExistsAsync is otherwise identical and is already injected into UserPurgeService -- but it reads through the proxy, and GetHumanAsync returns null for ANY non-success. So a Poracle that is merely unreachable is indistinguishable from an account that does not exist, and the method would answer false. AdminController turns false into 404, so an outage would report the account an admin is deleting as already gone. The database read is the correct one here precisely because it does not depend on Poracle being up. Refs jfberry/PoracleNG#214
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two of the three loose ends from auditing what still needs the Poracle database. One is a deletion; the other turned out not to be safe, and this records why.
Deleted:
IHumanRepository.GetByIdAsyncNo callers, tests included.
HumanService.GetByIdAsyncreads through the proxy, so all thirty-odd controller call sites are already on the API — this method was left behind by that migration and nothing noticed.Not done: moving
ExistsAsyncoff the databaseI proposed this as the other cheap win. It isn't one.
IHumanService.ExistsAsyncis otherwise identical, andUserPurgeServicealready injectsIHumanService, so the swap looked like a one-liner. But it reads throughGetHumanAsync, which returnsnullfor any non-success:So a Poracle that is merely unreachable is indistinguishable from an account that does not exist, and
ExistsAsyncwould answerfalse.AdminControllerturnsfalseinto a 404 — meaning during a Poracle outage, an admin deleting a user would be told the account is already gone.The database read is the correct one here precisely because it does not depend on Poracle being up. The call site now carries a comment saying so, so it does not get tidied away later by someone applying the same reasoning I did.
This is the shape
CLAUDE.mdwarns about: tightening a rule without enumerating who depended on the loose one. The loose thing being depended on was "this check works when Poracle is down".The third loose end, filed rather than fixed
HumanRepository.GetByIdsAsyncbatch-reads humans by id for the admin geofence review list, resolving owner and reviewer names. v2 is single-{id}, so through the API that becomes one request per distinct person on the page. Swapping one query for an N+1 would be a regression, so it stays until upstream offers a batch read — raised on jfberry/PoracleNG#214.What still needs the Poracle database after this
UserAreaDualWriter, 6 methodssetAreasuserSelectablefilterProfileRepository.RenameAsync/UpdateAsyncactive_hoursonlyHumanRepository.GetAllAsync/GetWebhooksAsync/DeleteUserAsync/GetByIdsAsyncHumanRepository.ExistsAsyncPoracleSchemaVersionReader/healthUserAreaDualWriter.SetAlarmOverrideAreasAsyncPwebSettingRepositorypweb_settingsmigration sourceThree
DbSets remain:Humans,Profiles,PwebSettings. Every alarm table is gone as of #827, so a direct alarm write is a compile error.Verification
Backend 2595 passing, unchanged. Two files, six lines removed, five comment lines added.