Fix FS3511 warnings in code and set Warnings-as-Errors#55
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d70a47ae4f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let actorId = | ||
| if reminder.ActorId.Length > 8 then | ||
| reminder.ActorId.Substring(0, 8) |
There was a problem hiding this comment.
Guard null ActorId before truncation
In the list-reminders table rendering, reminder.ActorId.Length/Substring are called without a null check (Admin.CLI.fs). The previous version explicitly handled String.IsNullOrEmpty, so older reminders or deserialized records missing ActorId can now trigger a NullReferenceException, aborting the command for those datasets. Consider normalizing to an empty string or checking String.IsNullOrEmpty before truncating so null/empty actor IDs still render safely.
Useful? React with 👍 / 👎.
There were 18 different instances of the FS3511 warning in the code that had built up. I ran a task to refactor all instances of it to eliminate the warning and add guidance to AGENTS.md to avoid it. I then turned on warnings-as-errors for the entire solution.
The nuisance is that I also turned on Fantomas reformatting, and so that caught most of the files in the solution for reformatting. It's a big PR, but, really, there should be no behavior changes in the code.