Repository navigation
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 6 |
| Duplication | 3 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
✅ No blocking issues noticed
No blocking findings were identified.
Test suggestions
- A zero pollMs value falls back to the default zero value.
- A negative pollMs value falls back to the default zero value.
- The smallest positive pollMs value is preserved.
- A missing pollMs value retains the default zero value.
TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback
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 #315.
LoadTUIConfigcopied any storedpollMsvalue intocfg.PollMswithout checking it. Iftui-config.jsonwas hand-edited or corrupted to hold0or a negative number, that value went straight to callers. A caller using it as a polling interval would then either busy-loop or never poll.Change: the stored value is now used only when it is greater than zero. Otherwise
cfg.PollMsstays at its default, the unset zero value, the same as whenpollMsis missing from the file. There is no separate default poll interval constant in the codebase. The unset zero value is the existing default, andTestLoadTUIConfigMissingFileReturnsDefaultalready checks for it.I chose to fall back to the default rather than return an error, as the issue asks. This also fits
LoadTUIConfig's current signature: it returns no error, and it already falls back to defaults when the file is missing or the JSON is invalid.Tests: added
TestLoadTUIConfigPollMsValidation, which covers the boundary values:0falls back to the default-1falls back to the default1, the smallest valid value, is keptI couldn't run the tests in this environment.
Fixes #315
Happy to adjust anything or close it if it isn't a fit.