refactor(storage): extract WebhookRepository across all three storage adapters#125
Merged
KIvanow merged 1 commit intoMay 1, 2026
Merged
Conversation
Addresses the TODO on postgres.adapter.ts L49. Extracts all webhook and delivery methods from PostgresAdapter, SqliteAdapter, and MemoryAdapter into dedicated WebhookRepository classes under apps/api/src/storage/adapters/repositories/. Each adapter becomes a thin facade that delegates to its repository. Zero behavior changes - existing webhook-storage test suite (25 tests) passes unchanged. Establishes the pattern for extracting the remaining domains (ACL, anomaly, slowlog, commandlog, latency, memory, hotkeys, etc.) in follow-up PRs. Made-with: Cursor
|
All contributors have signed the CLA. ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
Author
KIvanow
approved these changes
Apr 30, 2026
Member
|
Looks good overall! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Implements the first step of the TODO on
postgres.adapter.tsline 49:Extracts all webhook and delivery methods from
PostgresAdapter,SqliteAdapter, andMemoryAdapterinto dedicated repository classes underapps/api/src/storage/adapters/repositories/. Each adapter becomes a thin facade that delegates to its repository. Follows the same pattern established in PR #13 (MultiConnectionPoller base class extraction).Changes
repositories/webhook.postgres.repository.ts— new, owns all Postgres webhook/delivery SQLrepositories/webhook.sqlite.repository.ts— new, owns all SQLite webhook/delivery SQLrepositories/webhook.memory.repository.ts— new, owns all in-memory webhook/delivery logicpostgres.adapter.ts— delegates toWebhookPostgresRepository, retainsif (!this.pool)guardssqlite.adapter.ts— delegates toWebhookSqliteRepository, retainsif (!this.db)guardsmemory.adapter.ts— delegates toWebhookMemoryRepository, Maps moved into repositoryZero behavior changes. All three adapters implement the same
StoragePortinterface contract as before.The updated TODO now lists the remaining domains to extract:
Checklist