Skip to content

chore: improved backfill speed, notably when unblocking a user#181

Merged
highesttt merged 1 commit into
mainfrom
backfill-speed-improvements
Jun 11, 2026
Merged

chore: improved backfill speed, notably when unblocking a user#181
highesttt merged 1 commit into
mainfrom
backfill-speed-improvements

Conversation

@highesttt

Copy link
Copy Markdown
Collaborator

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a064e2fb-3f1d-42de-8c52-ed474a754417

📥 Commits

Reviewing files that changed from the base of the PR and between e1fd206 and 11fc156.

📒 Files selected for processing (2)
  • pkg/connector/client.go
  • pkg/connector/sync.go
📜 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). (4)
  • GitHub Check: build-docker
  • GitHub Check: Build 1.25
  • GitHub Check: build-docker
  • GitHub Check: Build 1.25
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Use go fmt for code formatting across all Go files
Use goimports with -local "github.com/highesttt/matrix-line-messenger" flag to group project-local imports correctly
Use zerolog for logging throughout the codebase
Do not use Msgf in logging; use Msg with structured fields instead
Use Stringer interface where applicable in Go code

Files:

  • pkg/connector/client.go
  • pkg/connector/sync.go
**/!(ltsm)/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/!(ltsm)/**/*.go: Run staticcheck on all Go files excluding pkg/ltsm package (transpiled WASM code)
Run go vet on all Go files excluding pkg/ltsm package (transpiled WASM code)

Files:

  • pkg/connector/client.go
  • pkg/connector/sync.go
🔇 Additional comments (9)
pkg/connector/sync.go (8)

27-27: LGTM!


29-53: LGTM!


91-91: LGTM!


95-148: LGTM!


254-296: LGTM!


764-771: LGTM!


867-882: LGTM!


150-155: LGTM!

pkg/connector/client.go (1)

280-283: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of blocked-contact synchronization during connection
    • Enhanced DM chat recovery and backfilling behavior
    • Optimized message prefetching with concurrent processing for faster startup

Walkthrough

The PR refactors blocked-contact fetching and DM synchronization in the LINE connector. A new refreshBlockedContacts helper centralizes blocked-contact retrieval and cache updates, integrating into Connect and fullSync. DM chat resync and backfill unify into a single call with a forceBackfill flag, simplifying the unblock flow. Startup message prefetch switches from serial to bounded-concurrency workers.

Changes

Blocked Contact Refresh and DM Sync Optimization

Layer / File(s) Summary
Blocked contacts refresh helper and integration
pkg/connector/sync.go, pkg/connector/client.go
New refreshBlockedContacts fetches blocked contact IDs from LINE with token recovery, converts them to a cached lookup map, and is called from both Connect startup and fullSync sync polling.
DM chat resync with unified forced backfill
pkg/connector/sync.go
queueDMChatResync accepts a new forceBackfill parameter, wiring ChatInfo.CanBackfill and optionally forcing immediate backfill. OpUnblockContact now makes a single resync call with forced backfill instead of separate queue operations.
Message prefetch concurrency optimization
pkg/connector/sync.go
prefetchMessages switches from serial to bounded worker pool with configurable concurrency, skips blocked users, and respects context cancellation.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided by the author, which is a missing required element. Add a pull request description explaining the motivation, approach, and any testing performed for the backfill speed improvements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: improved backfill speed optimization, particularly when unblocking a user.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backfill-speed-improvements

Comment @coderabbitai help to get the list of available commands and usage tips.

@highesttt highesttt merged commit 6e31cbf into main Jun 11, 2026
9 checks passed
@highesttt highesttt deleted the backfill-speed-improvements branch June 11, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant