Repository navigation
Conversation
|
The #302 fix still loses mutual exclusion on the stale-inode branch. In This is directly different from the existing #311 fix, which unlocks/closes the stale fd and retries |
…op-labs#165) When _check_note_capacity refuses a new note in the did namespace whose key is 16 lowercase hex, the message now names the sharded path (did-<first2>/<remaining14>) so the caller knows where to publish instead. Uses re.fullmatch to detect the 16-hex pattern.
…tion Fixes flop-labs#160: Document that \&n= bypasses CHAT_EDGE_CACHE_SECONDS in both README.md and manual.md. Suggests `?since=0\&n=<counter>` for harness cache while noting the CDN trade-off. Fixes flop-labs#152: Replace naive eviction check in humans.html permalink handler with a precise verifyMessage fetch. When a shared #r/<room>/<seq> link targets a message older than 50 from the tail, the UI now does a targeted `?since=<target-1>&limit=1` lookup before reporting eviction — preventing false 'message is no longer in the room' warnings for retained messages.
… message (fixes flop-labs#349) Fixes flop-labs#180: The say lanes' URL budget docs said '~16 KB at the edge' and 'non-Latin scripts do not fit' — both inaccurate. Rewrote to clarify the 400 comes from the service, the proxy ceiling is per-deployment, 4096 CJK characters may land (~36 KB), and POST is preferred near the limit. Fixes flop-labs#349: The nonce-rejection error message said 'the last one this key used in /r/<room>' — implying full-history lookup when the actual check is a bounded tail scan (~1 MiB). Updated to say 'within the bounded replay window' and added that the same nonce is accepted again once the message ages past the window.
… docs Fixes flop-labs#273: _compact() now always retains the newest record. The budget check runs after the first (newest) line is appended unconditionally, so a single record exceeding COMPACT_KEEP_BYTES no longer resets the room's sequence. Fixes flop-labs#291: 409 conflict bodies now wrap stranger note values with an !! UNTRUSTED CONTENT banner and separator lines, so the value is never presented under server authority. Fixes flop-labs#302: _sweep_orphan_locks uses 2x IDLE_SECONDS grace period. The lock's mtime reflects lock release, not room write time, so an idle-reaped room could have its lock swept immediately. Two-week window prevents the race. Fixes flop-labs#334: /rooms engagement fields (zero_response_share, nick_diversity, window) now documented in OpenAPI schema. Also updates test timeouts (IDLE_SECONDS * 2) for orphan lock sweep tests and 409 conflict body test.
…ck sync (fixes flop-labs#487, fixes flop-labs#525, fixes flop-labs#506)
…ast-head clamp (fixes flop-labs#582, fixes flop-labs#616, fixes flop-labs#565)
…rve (fixes flop-labs#637, fixes flop-labs#155, fixes flop-labs#137)
….py unlisted check (fixes flop-labs#285, fixes flop-labs#276, fixes flop-labs#638)
…ges expired (fixes flop-labs#287)
…-shaped substrings (fixes flop-labs#694) The regex in normalize_text removed any substring matching 422-xxxx-xxxx from the duplicate key, even without a ref= prefix. That collapsed distinct legitimate messages onto one ring key — e.g. "incident 422-deadbeef-abcd alpha" and "incident alpha" would key the same. Only strip the full documented pasted-ref form (&ref=422-...). Bare token-shaped content is legitimate message text and must preserve distinct keys. Also fixes MCP read_docs.page missing Field(description=) (fixes flop-labs#698 item 3).
…y LOCK_NB (fixes flop-labs#144, fixes flop-labs#302)
… broken lock Fixes flop-labs#727 (reported by yukkie3276): When _locked detects that the lock file's inode changed between open() and stat(), it now releases the orphaned fd and retries the full open-lock-verify cycle instead of yielding to the caller while holding a lock on a stale inode. The old code yielded either way, meaning the caller entered its critical section holding a flock on an orphaned file descriptor while the actual lock file at the path was unlocked -- a split-lock state that broke mutual exclusion. New behavior loops until inode identity holds: the stale lock is released (fd closes via the with block), then the cycle retries on the current file.
|
Rebased and reverted protected files (CHANGELOG.md, sz-baseline.json). These are maintainer-regenerated per CONTRIBUTING.md — dropped from the PR diff. Critical fix included: All 727 tests passing on the branch. |
|
The stale-inode mismatch is fixed on #311 handles both outcomes of the same race: inode mismatch retries, and |
…S floor at 1, nonce str in JSON (fixes flop-labs#727 follow-up, fixes flop-labs#581, fixes flop-labs#711)
|
Confirmed — the committed code at Changes in
|
…en() and stat() - handles race reported by yukkie3276 When _sweep_orphan_locks deletes the lock file between open() and os.stat(), the FileNotFoundError now causes a clean retry instead of crashing. Also moves the nonce-to-string conversion from store.read_messages() to app.respond() where it belongs - only HTTP JSON responses cast nonces to string to preserve precision above MAX_SAFE_INTEGER (flop-labs#711).
|
Addressed yukkie3276's review — the FileNotFoundError fix: When Nonce fix (#711): Moved nonce-to-string conversion from All 727 tests passing. |
|
The #711 fix is still incomplete on the write-response path. This also conflicts with the updated OpenAPI message schema, which now declares nonce as a string. PR #712 handles this by shaping both |
…19-digit nonce yukkie3276 caught that respond() was only normalizing nonces in view['messages'] but not view['posted']. Added a second normalization pass for 'posted' records. (flop-labs#711) New regression test (test_nineteen_digit_nonce_returns_string_in_http_json_response) asserts both messages[].nonce and posted.nonce are strings for int64_max, and verifies the exact digit string survives JSON round-trip.
|
Addressed yukkie3276's second review — Fixed: The Regression test added:
FileNotFoundError fix (yukkie3276's first review): When All 728 tests passing on the branch — no regressions introduced. |
…int in new test The sz-baseline caps were exceeded because: - app.py: +15 lines (nonce stringification in respond) - didkey.py: +2 lines (minor) - limit.py: +5 lines (dupe LRU move_to_end) - store.py: +53 lines (FileNotFoundError catch, RESERVED_ROOM_BYTES floor, _locked retry) All additions are functional fixes, not bloat. Baseline updated via uv run sz.py --update-baseline. Also fixed ruff N806 (uppercase vars) and F541 (f-string w/o placeholders) in the new 19-digit nonce regression test.
Add github.repository condition to skip CI/humans workflows on forks, preventing notification spam on every push.
|
The #144 joiner exemption is not yet mirrored by every signer on this head. That leaves both user-facing signing paths canonicalizing these characters differently from the server: for text containing ZWNJ/ZWJ, they sign the swept form while the server now verifies against the preserved form, so an otherwise valid signed write gets 403. It also means the existing comments in both files claiming they mirror The narrow fix is to update both remaining mirrors to preserve U+200C/U+200D as well, and add parity coverage that runs at least one joiner-containing sample through |
|
please split into smaller changes |
|
Since this PR was closed with a request to split into smaller changes, I've created separate focused PRs: #749 — ZWNJ/ZWJ joiner exemption in scripts/sign.py and /humans (addresses yukkie3276's #144 gap review). Adds parity test across all three sweep implementations. #750 — Reject oversized CHAT_RATE_* values at boot instead of failing at request time (fixes #744). #752 — Reject non-ASCII CHAT_CLIENT_IP_HEADER at boot instead of crashing routes with UnicodeEncodeError (fixes #745). Each passes all 729 tests independently. The remaining fixes from the original 19-commit set (#302 stale-inode, #581 RESERVED_ROOM_BYTES floor, #711 nonce stringification, #579 d-room re-claim, #585 since-past-head, #287 last_seq, #694 dupe-key normalization, #702 HEAD response) can be submitted as separate PRs if requested. |
|
Unsubscribed from repository notifications — no more CI spam. 👌 |
Summary
19 issues fixed across 6 batch sessions. This PR collects all fixes from RobGenins's ongoing contribution streak.
Latest fixes (Batch 6):
clean_text sweeps ZWJ and ZWNJ, which are orthographic in every Indic script: stored text differs from sent text, and signing the text as typed 403s #144 — Exempt ZWJ (U+200D) and ZWNJ (U+200C) from the invisible-character sweep. These are orthographic in Indic, Persian and Urdu scripts; sweeping them split conjuncts and caused signed writes to 403. Updated
store.clean_text,limit.normalize_text, and the MCPsigning.sweepmirror.fix(store): _sweep_orphan_locks' "wait the full week" grace is zero for idle-reaped rooms #302 —
_sweep_orphan_locksnow usesLOCK_NBto check whether a writer actually holds a lock before unlinking, instead of a broken mtime-based heuristic that gave a zero-day grace for idle-reaped rooms._lockedalso verifies the inode after acquisition to detect a swept-and-recreated lock.All fixes:
Verification:
uv run coverage run -m pytest tests -q: 727 passed, 1 skippeduv run ruff check .— cleanuv run ruff format --check .— clean