-
Notifications
You must be signed in to change notification settings - Fork 4
fix: pictique replay #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: pictique replay #338
Conversation
Caution Review failedThe pull request is closed. WalkthroughUpdates a UI label in a Svelte settings page. Enhances a web3 adapter subscriber by adding in-flight change deduplication via a pendingChanges map, delayed processing with safeguards, and a periodic cleanup routine removing stale entries. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant DB as DB Change Feed
participant Sub as Subscriber
participant Lock as Lock Checker
participant H as handleChange
participant Timer as Cleanup Timer
Note over Sub: Initialization
Timer->>Sub: setInterval(5m)
Sub->>Sub: cleanupOldPendingChanges(>10m)
Note over DB,Sub: Regular entity change
DB-->>Sub: onChange(tableName, id)
Sub->>Sub: changeKey = tableName:id
alt changeKey pending
Sub-->>DB: Skip (duplicate)
else not pending
Sub->>Sub: pendingChanges[changeKey] = now
Sub->>Sub: setTimeout(3s)
Sub-->>Sub: After 3s
Sub->>Lock: isLocked(globalId?)
alt locked
Sub-->>Sub: Skip processing
else unlocked
Sub->>H: handleChange(tableName, id)
end
Sub->>Sub: finally: delete pendingChanges[changeKey]
end
Note over DB,Sub: Junction table change
DB-->>Sub: onJunctionChange(entity, parentId)
Sub->>Sub: changeKey = junction:entity:parentId
alt changeKey pending
Sub-->>DB: Skip (duplicate)
else not pending
Sub->>Sub: pendingChanges[changeKey] = now
Sub->>Sub: setTimeout(3s)
Sub-->>Sub: After 3s
Sub->>Lock: isLocked(globalId of parent?)
alt locked
Sub-->>Sub: Skip processing
else unlocked
Sub->>H: handleChange(entity, parentId)
end
Sub->>Sub: finally: delete pendingChanges[changeKey]
end
Note over Timer,Sub: Periodic cleanup logs purged keys
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Description of change
Issue Number
Type of change
How the change has been tested
Change checklist
Summary by CodeRabbit
Chores
Bug Fixes