feat(locks): add no-op for locking without redis to allow deployments without redis#2703
Merged
waleedlatif1 merged 2 commits intostagingfrom Jan 7, 2026
Merged
feat(locks): add no-op for locking without redis to allow deployments without redis#2703waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
enables deployments without Redis by implementing no-op locking behavior when Redis is unavailable
- removed unused Redis functions:
isRedisConnected(),getRedisStatus(),hasProcessedMessage(),markMessageAsProcessed(),getLockValue() - modified
acquireLock()to returntrue(no-op) when Redis unavailable, allowing single-replica deployments to function - modified
releaseLock()to silently returntrue(no-op) when Redis unavailable - removed corresponding test mocks for deleted functions
- relies on
IdempotencyServicedatabase fallback for duplicate prevention in multi-replica deployments without Redis
Confidence Score: 4/5
- safe to merge with minor log spam concern in no-Redis deployments
- change correctly implements no-op locking to allow Redis-less deployments with database-backed idempotency as fallback. main concern is warning message in
acquireLock()could generate log spam for frequently-called polling endpoints - pay attention to
apps/sim/lib/core/config/redis.tsfor potential log spam from warning message
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/lib/core/config/redis.ts | 4/5 | added no-op for locking without Redis and removed unused functions; warning message could cause log spam |
| apps/sim/app/api/webhooks/trigger/[path]/route.test.ts | 5/5 | removed unused mocks for deleted Redis functions |
Sequence Diagram
sequenceDiagram
participant Client as Webhook/Polling Request
participant Lock as acquireLock()
participant Redis as Redis Client
participant Idem as IdempotencyService
participant Handler as Request Handler
Client->>Lock: acquireLock(key, value, ttl)
Lock->>Redis: getRedisClient()
alt Redis Available
Redis-->>Lock: Redis instance
Lock->>Redis: SET key value EX ttl NX
Redis-->>Lock: "OK" or null
Lock-->>Client: true/false
else Redis Not Available
Redis-->>Lock: null
Note over Lock: Silent no-op
Lock-->>Client: true (allow operation)
end
Client->>Handler: Process request
Handler->>Idem: executeWithIdempotency()
Note over Idem: DB fallback handles<br/>duplicate prevention
Idem-->>Handler: Result
Handler-->>Client: Response
Collaborator
Author
|
@greptile |
Contributor
Greptile SummaryThis PR enables the application to run without Redis by converting the distributed locking functions (
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant PollingEndpoint
participant acquireLock
participant Redis
participant IdempotencyService
participant DB
Client->>PollingEndpoint: GET /api/webhooks/poll/gmail
PollingEndpoint->>acquireLock: acquireLock(key, value, ttl)
alt Redis Available
acquireLock->>Redis: SET key value EX ttl NX
Redis-->>acquireLock: OK or null
acquireLock-->>PollingEndpoint: true/false
else Redis Unavailable (new behavior)
acquireLock-->>PollingEndpoint: true (no-op)
end
alt Lock acquired
PollingEndpoint->>IdempotencyService: Process with deduplication
alt Redis Available
IdempotencyService->>Redis: Check/store idempotency key
else Redis Unavailable
IdempotencyService->>DB: Check/store idempotency key (fallback)
end
PollingEndpoint-->>Client: 200 Completed
else Lock not acquired
PollingEndpoint-->>Client: 202 Skipped (already in progress)
end
|
waleedlatif1
added a commit
that referenced
this pull request
Jan 8, 2026
… without redis (#2703) * feat(locks): add no-op for locking without redis to allow deployments without redis * ack PR comments, fixed worklfow block color
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
Tested manually
Checklist