Skip to content

fix(mastodon): improve autocompletion scan performance and UX#899

Open
kastwey wants to merge 1 commit intoMCV-Software:next-genfrom
kastwey:feature/autocompletion-scan-improvements
Open

fix(mastodon): improve autocompletion scan performance and UX#899
kastwey wants to merge 1 commit intoMCV-Software:next-genfrom
kastwey:feature/autocompletion-scan-improvements

Conversation

@kastwey
Copy link
Contributor

@kastwey kastwey commented Jan 31, 2026

  • Use dict instead of list for duplicate checking (O(1) vs O(n) per lookup),
    which is faster and more idiomatic for large datasets.
  • Add detailed progress dialog with:
    • Account info (followers/following/total counts)
    • Current status and page number.
    • Users processed counter.
    • Visual progress bar.
    • Cancel button to stop scan gracefully.
  • Refactor scan logic into reusable _scan_users() method with ScanType enum.
  • Show accurate completion stats (new users vs already in database).
  • Fix window close behavior (X button now cancels instead of crashing).
  • Add 15 unit tests for storage and scan logic.
  • Fix storage.del to handle already-closed connections.

- Fix O(n²) to O(1) complexity when checking for duplicate users
  The original code used `if user not in list` which caused scans
  to hang for hours on accounts with many followers. Now uses dict
  keyed by user ID for instant lookups.
- Add detailed progress dialog with:
  - Account info (followers/following/total counts)
  - Current status and page number
  - Users processed counter
  - Visual progress bar
  - Cancel button to stop scan gracefully
- Refactor scan logic into reusable _scan_users() method with ScanType enum.
- Show accurate completion stats (new users vs already in database).
- Fix window close behavior (X button now cancels instead of crashing).
- Add 15 unit tests for storage and scan logic.
- Fix storage.__del__ to handle already-closed connections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants