fix: backfill not working in specific circumstances#182
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughDetects newly unblocked LINE contacts by diffing refreshed blocked lists vs cached+metadata, persists blocked-contact snapshots, queues immediate DM resyncs and a delayed backfill fallback per unblocked MID, and adds retry/metrics to recent-message backfill. ChangesUnblock Recovery Workflow
Sequence Diagram(s): sequenceDiagram
participant SSE as SSE fullSync
participant Refresh as refreshBlockedContacts
participant Cache as lc.blockedUsers
participant Queue as queueUnblockedDMRestore
participant Portal as queueDMChatResync
participant Fallback as queueUnblockBackfillFallback
SSE->>Refresh: request fresh blocked list
Refresh->>Cache: diff & update cache\ncompute newlyUnblocked
Refresh-->>SSE: ([]string newlyUnblocked, error)
SSE->>Queue: for each newlyUnblocked MID -> queueUnblockedDMRestore(mid, reason)
Queue->>Portal: queue immediate DM chat resync (portal create + silent backfill)
Queue->>Fallback: schedule delayed recheck/backfill
Fallback->>Portal: after delay, if still unblocked -> queue DM chat resync
🎯 4 (Complex) | ⏱️ ~45 minutes Possibly Related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
- unblocks while bridge was offline were not detected - unblocks could trigger unwanted notifications - removed duplicate function
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/connector/client.go`:
- Around line 281-286: Seed lc.blockedUsers from the persisted snapshot
(UserLoginMetadata.BlockedMIDs) before calling lc.refreshBlockedContacts so that
syncDMChats and prefetchMessages see the last-known block state if the refresh
fails; then call lc.refreshBlockedContacts and only when it succeeds iterate
newlyUnblocked to call lc.queueUnblockedDMRestore(ctx, mid, "startup"). In
short: populate lc.blockedUsers from lc.UserLogin.Metadata.BlockedMIDs first,
call lc.refreshBlockedContacts next, and avoid queuing restores when refresh
returns an error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e79feb4a-31d6-44b4-9cdf-8f4ebf023629
📒 Files selected for processing (3)
pkg/connector/client.gopkg/connector/connector.gopkg/connector/sync.go
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-docker
- GitHub Check: build-docker
🧰 Additional context used
📓 Path-based instructions (3)
**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
**/*.go: Usego fmtfor code formatting across all Go files
Usegoimportswith-local "github.com/highesttt/matrix-line-messenger"flag to group project-local imports correctly
Usezerologfor logging throughout the codebase
Do not useMsgfin logging; useMsgwith structured fields instead
UseStringerinterface where applicable in Go code
Files:
pkg/connector/connector.gopkg/connector/client.gopkg/connector/sync.go
**/!(ltsm)/**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
**/!(ltsm)/**/*.go: Runstaticcheckon all Go files excludingpkg/ltsmpackage (transpiled WASM code)
Rungo veton all Go files excludingpkg/ltsmpackage (transpiled WASM code)
Files:
pkg/connector/connector.gopkg/connector/client.gopkg/connector/sync.go
pkg/connector/connector.go
📄 CodeRabbit inference engine (AGENTS.md)
Implement
bridgev2.NetworkConnectorandbridgev2.NetworkAPIinterfaces in the connector package for bridge logic
Files:
pkg/connector/connector.go
🔇 Additional comments (2)
pkg/connector/connector.go (1)
101-114: LGTM!pkg/connector/sync.go (1)
33-112: LGTM!Also applies to: 209-248, 882-887, 971-972, 995-1002
Co-authored-by: indent[bot] <216979840+indent[bot]@users.noreply.github.com>
No description provided.