Repository navigation
fix(web): add 3 missing audit actions + FarmLogo entityType to filter/labels (#247) - #255
Merged
Merged
Conversation
…e filter/labels (#247) The server emits 31 distinct audit action codes; the client's typed AUDIT_ACTION_VALUES listed 28, silently dropping three real writes from the /audit action filter (rows showed only under 'All actions'): - Account.SetLogo (SetFarmLogoHandler, entityType FarmLogo) - Account.RemoveLogo (RemoveFarmLogoHandler, entityType FarmLogo) - Account.UpdateSettings (UpdateFarmSettingsHandler, entityType Account) And logo rows carried entityType 'FarmLogo', absent from ENTITY_TYPE_VALUES, so entityTypeLabel degraded it to the raw 'FarmLogo' string. - enums.ts: add the 3 codes to AUDIT_ACTION_VALUES + AUDIT_ACTION_KEYS, and FarmLogo to ENTITY_TYPE_VALUES + ENTITY_TYPE_KEYS (the satisfies maps keep values/keys exhaustive at compile time; the ENUMS registry auto-covers them in enums.test). - en/es/tl: friendly enums:auditAction.* + enums:entityType.FarmLogo labels ('Farm logo set' / 'Farm logo removed' / 'Farm settings updated' / 'Farm logo'), machine-drafted es/tl matching the existing audit-label style. - AuditPage.test: the 3 actions are now offered as filterable options (labelled + value-preserved), and a FarmLogo row renders the friendly label not the raw code. Mutation-probed. Pre-existing drift surfaced by the #182 B5 review, not a regression. The root cause (hand-maintained client action list, #84 magic-strings debt) and its longer-term server-derived-enum prevention remain tracked on #247.
Owner
Author
Review — unanimous approve (codex + 2 Claude agents + pi)
Independently verified by reviewers (against server source, not just the diff):
Root cause still open (tracked on #247): the hand-maintained client list can drift again — the longer-term server-derived-enum prevention is a separate, larger change. Verified: |
This was referenced Jul 28, 2026
Closed
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.
Fixes #247 — the audit-log action filter + entityType labels drifted from the server.
Gap (pre-existing, surfaced by the #182 B5 review — not a regression)
The server emits 31 distinct
audit.WriteAsyncaction codes; the client's typedAUDIT_ACTION_VALUESlisted 28, silently dropping three real writes from the/auditaction filter (rows showed only under All actions):Account.SetLogoAccount.RemoveLogoAccount.UpdateSettingsAnd logo rows carried
entityType = "FarmLogo", which was not inENTITY_TYPE_VALUES, soentityTypeLabeldegraded it to the rawFarmLogostring.Fix (client-side only, exactly per the issue)
AUDIT_ACTION_VALUES+AUDIT_ACTION_KEYS, andFarmLogotoENTITY_TYPE_VALUES+ENTITY_TYPE_KEYS. Theas const satisfies Record<Union, EnumsKey>maps keep values↔keys exhaustive at compile time; theENUMSregistry auto-covers the new values inenums.test.Tests
AuditPage.test: the 3 actions are now offered as filterable options (labelled + value-preserved); aFarmLogorow renders the friendly label, not the raw code. Mutation-probed (removing the enums entries fails both).npm run test1177 green · typecheck clean · build ok ·i18n:scan3 (false positives) ·catalogParity+enumsregistry green.Out of scope / still tracked on #247
The root cause — a hand-maintained client action list (#84 magic-strings debt) that can silently drift from the server — remains. #247's longer-term prevention (derive/validate
AUDIT_ACTION_VALUESagainst a server-emitted enum or/audit/actionsmetadata) is a separate, larger change, left for that issue.Not included
Unrelated local working-tree edits (
deploy/docker-compose.yml,web/vite.config.ts) deliberately not in this branch.