Skip to content

Fix: Allow sync to bypass ActorLimit (Issue #951)#965

Merged
jnunemaker merged 3 commits into
mainfrom
jnunemaker/sync-bypass-limit
Jan 15, 2026
Merged

Fix: Allow sync to bypass ActorLimit (Issue #951)#965
jnunemaker merged 3 commits into
mainfrom
jnunemaker/sync-bypass-limit

Conversation

@jnunemaker

Copy link
Copy Markdown
Collaborator

Summary

When syncing from Cloud, the ActorLimit adapter would prevent syncing actors if the remote had more actors than the local limit allowed, creating an unrecoverable state. This fix adds thread-local sync mode to ActorLimit that disables limit enforcement during sync operations while still enforcing limits on user-initiated operations. Cloud can now sync all data without being blocked by local actor limits.

Test Plan

  • Added regression test demonstrating sync fails without the fix when remote exceeds local limit
  • Added 8 new tests covering sync mode behavior: defaults, setting, block context, exception handling, return values, and limit bypass
  • All 2,756 existing tests pass

🤖 Generated with Claude Code

jnunemaker and others added 3 commits January 15, 2026 17:09
When syncing from Cloud, the ActorLimit adapter would prevent syncing
actors if the remote had more actors than the local limit allowed. This
created an unrecoverable state where users couldn't recover by removing
actors in Cloud because sync would fail before removals could process.

Add thread-local sync mode to ActorLimit that disables limit enforcement
during sync operations. This allows Cloud (the source of truth) to sync
all data while still enforcing limits on user-initiated operations.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Verify that preloading works correctly when using a Sync adapter
wrapped with ActorLimit, even when the remote has more actors than
the local limit allows.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Test incremental sync: 20 actors synced, then 21st added and synced
- Test that direct enable operations still enforce limits after sync
- Use 10/20 actor ratio to better simulate realistic Cloud scenario

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@jnunemaker jnunemaker self-assigned this Jan 15, 2026
@jnunemaker
jnunemaker merged commit e577bec into main Jan 15, 2026
46 checks passed
@jnunemaker
jnunemaker deleted the jnunemaker/sync-bypass-limit branch January 15, 2026 23:21
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.

1 participant