Commit 08fb4f1
authored
fix: stop rewriting the wiki every run (hash excludes Last Updated timestamp) (#35)
## Bug (in prod)
`update_wiki_page` hashes the full wiki content, which begins with
`**Last Updated:** <current time>` (`build_wiki_content`). Because the
timestamp changes every run, `content_hash` is always new, `cached_hash
== content_hash` is never true, and the page is **rewritten with a fresh
revision every ~10 min even when nothing changed**. The entire
`wiki_hash_cache` table is dead weight.
**Impact:** needless Reddit wiki writes + revision-history spam. Not
data corruption.
## Fix
`get_content_hash` strips the volatile `Last Updated` line before
hashing, so the change-detection hash reflects only the modlog body.
Self-heals after one write post-deploy.
## Verification
- timestamp-only diff → identical hash (skip now works) ✓
- body change → different hash (still writes) ✓
- existing test suite passes (no regression)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Wiki updates now skip unchanged content more reliably, reducing
unnecessary edits.
* Continuous and forced refresh flows are more consistent when
rebuilding wiki pages.
* **Bug Fixes**
* Improved handling of wiki size limits and API errors for more reliable
updates.
* Better formatting and cleanup of moderation entries, including
timestamps and removal reasons.
* Faster and more dependable data lookup during wiki generation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent aef6a2e commit 08fb4f1
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
371 | 378 | | |
372 | 379 | | |
373 | 380 | | |
| |||
0 commit comments