forked from retoor/devplacepy
docs: add block/mute user relations, emoji-sync CLI, and uid indexes
- Add `/block`, `/mute` endpoints with block/unblock and mute/unmute functionality in `routers/relations.py`, hiding blocked users' content everywhere except their own profile while muting only suppresses notifications - Introduce `devplace emoji-sync` CLI command to regenerate `static/js/emoji-shortcodes.js` from the emoji library, documented in `CLAUDE.md` and wired in `cli.py` - Create `get_blocked_uids()` database helper and apply it in `content.py` `load_detail()` to filter blocked users' posts from detail views - Implement `_uid_index()` and `_drop_index()` helpers in `database.py` for unique uid indexes across tables, with `user_relations` added to `SOFT_DELETE_TABLES` - Document new routes in `AGENTS.md` and `README.md`, including emoji shortcodes rendering behavior distinct from the emoji picker
This commit is contained in:
@@ -21,7 +21,7 @@ The in-process caches (`_user_cache` in `utils.py`, `_settings_cache` in `databa
|
||||
- A mutation that must invalidate a cache calls `bump_cache_version(name)` - an atomic `UPDATE ... version + 1` in the shared table.
|
||||
- Before serving from a cache, the worker calls `sync_local_cache(name, cache)`, which reads the table's version and compares it to the version its local cache was built against; if they differ, it clears and rebuilds the local cache from the database. The version read is an uncached indexed primary-key lookup on the tiny `cache_state` table, so invalidation is immediate across workers.
|
||||
|
||||
A logout, ban, role change, or settings save in one worker is therefore honored by every other worker on its next request, while the common path stays a cheap in-memory hit. `auth` covers `_user_cache` (logout, deactivation, role and password changes); `settings` covers `_settings_cache` (every `set_setting` and the admin settings save).
|
||||
A logout, ban, role change, or settings save in one worker is therefore honored by every other worker on its next request, while the common path stays a cheap in-memory hit. The named versions in use are `auth` (covers `_user_cache`: logout, deactivation, role and password changes), `settings` (`_settings_cache`: every `set_setting` and the admin settings save), `relations` (block/mute lists), `customizations` (per-user CSS/JS), `notif_prefs` (notification preferences), `gateway_routing` (AI provider/model routes), and `admins` (the cached admin-user set behind `get_admin_uids`/`get_primary_admin_uid`, invalidated by `invalidate_admins_cache()` on every role change). Caches whose value is deterministic or only cosmetically stale do not use a version: the docs prose markdown is memoized on its static source, and the guest home page blocks use a short 60-second time-to-live.
|
||||
|
||||
## Rate limiting
|
||||
|
||||
|
||||
Reference in New Issue
Block a user