Skip to content

Fix/eliminate action not found race condition with rw lock#39

Closed
alekseysotnikov wants to merge 11 commits into
dynamic-alpha:mainfrom
alekseysotnikov:fix/eliminate-action-not-found-race-condition-with-RwLock
Closed

Fix/eliminate action not found race condition with rw lock#39
alekseysotnikov wants to merge 11 commits into
dynamic-alpha:mainfrom
alekseysotnikov:fix/eliminate-action-not-found-race-condition-with-RwLock

Conversation

@alekseysotnikov
Copy link
Copy Markdown
Contributor

@alekseysotnikov alekseysotnikov commented May 4, 2026

No description provided.

alekseysotnikov and others added 11 commits April 16, 2026 21:16
Adds `compact-uuids` library and switches frontend-facing IDs from hyphen (`-`) to underscore (`_`) separator (snake case).
## Rationale
- **Snake case:** allow double-click selection of entire ID in browser devtools
- **Compact UUIDs:** 26 chars vs 36 chars (30% smaller), URL-safe, no ambiguous characters (0/O, 1/l/I)
## Changes
1. **Compact UUIDs:** All UUID usages replaced with compact encoding
2. **Snake case:** Only frontend-facing IDs modified - action-id and tab-id
Problem: cleanup-tab-actions! created a gap where :actions was empty
between cleanup and re-registration. In-flight HTTP action requests
during this gap would fail with "Action not found".
Solution: Use ReentrantReadWriteLock (FIFO) per tab to serialize
cleanup+render (write lock) with action execution (read lock).
Don't re-create cursors in the examples

(cherry picked from commit c59b595)
Closes dynamic-alpha#35

Prevent reverse proxies such as NGINX and OpenResty from buffering or
transforming Hyper's SSE stream. In some managed hosting setups, that can
delay SSE patches and leave the UI stuck in transient states even though
the underlying action has already completed.

Send Cache-Control: no-cache, no-transform and X-Accel-Buffering: no
with Hyper's built-in /hyper/events response so SSE behaves reliably
behind those proxies while preserving the existing Brotli behavior.

(cherry picked from commit f49074c)

# Conflicts:
#	src/hyper/server.clj
Clarify commit message standards to have a target max length

(cherry picked from commit 03686a5)
Fix an issue where we couldn't use nil as a value on a signal

(cherry picked from commit 78bab7b)
Read *registered-action-ids* after HTML serialization.

The accumulator was captured before (c/html body), so actions
registered inside lazy hiccup sequences (for, map, etc.) were
missed.  sweep-stale-tab-actions! then removed every action for
the tab, causing "Action not found" on the next click.

Move (c/html body) before the deref so all lazily-realized
actions are included in the live set.

(cherry picked from commit 9d66c63)
Closes dynamic-alpha#37

When an app is served under a subfolder by a reverse proxy, all
internal /hyper/* endpoint URLs were previously hard-coded and had
to be patched manually. :base-path prefixes the system routes at
mount time and propagates the value through app-state so that
action expressions, navigate links, the SSE data-init attribute,
and the popstate fetch all emit the correct URLs automatically.

(cherry picked from commit 3532d3d)
@alekseysotnikov alekseysotnikov deleted the fix/eliminate-action-not-found-race-condition-with-RwLock branch May 4, 2026 16:42
@alekseysotnikov alekseysotnikov restored the fix/eliminate-action-not-found-race-condition-with-RwLock branch May 4, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants