Skip to content

Validate and coerce visitCount before incrementing#6

Open
Pine-Sensei wants to merge 1 commit into
mainfrom
codex/update-incrementcount-to-validate-visitcount
Open

Validate and coerce visitCount before incrementing#6
Pine-Sensei wants to merge 1 commit into
mainfrom
codex/update-incrementcount-to-validate-visitcount

Conversation

@Pine-Sensei
Copy link
Copy Markdown
Owner

Motivation

  • Ensure the stored visitCount is safely parsed and defaults to 0 for missing/invalid values so increments do not produce NaN or corrupt counts.

Description

  • Read visitCount from KV, parse with Number, use Number.isFinite(parsed) to fall back to 0 when invalid, increment to nextVisitCount, and persist the updated value back to KV with my_kv.put('visitCount', nextVisitCount.toString()).

Testing

  • No automated tests were run for this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant